Commit Graph

571 Commits

Author SHA1 Message Date
Jonas Schievink
dad2f75b91 Use ItemTree to answer enum_data query 2020-06-25 16:52:47 +02:00
Jonas Schievink
563d585594 Use IdRange for variants 2020-06-25 16:52:15 +02:00
Jonas Schievink
b06214d164 Generalize FieldIds -> IdRange<T> 2020-06-25 16:42:59 +02:00
Jonas Schievink
2a8fc9e682 adt.rs: fetch struct/union data from item tree 2020-06-25 16:41:08 +02:00
Jonas Schievink
d84b3ff6a1 Collect field/variant attrs in ItemTree 2020-06-25 14:39:27 +02:00
Jonas Schievink
9ba7726579 Allow iterating fields in the ItemTree 2020-06-25 13:50:27 +02:00
Jonas Schievink
2928600374 Reorder items 2020-06-24 16:54:21 +02:00
Jonas Schievink
d6fd7809b0 Clean up and fix inner item collection a bit 2020-06-24 16:54:21 +02:00
Jonas Schievink
3b50b0b2b6 Use a HashMap instead of Vec
This is no longer enforcing stack discipline, so a Vec isn't necessary
or helpful
2020-06-24 16:54:21 +02:00
Jonas Schievink
59d4640b64 Remove unneeded HirFileId argument 2020-06-24 16:54:21 +02:00
Jonas Schievink
d4ddec2bdf Shrink arenas after building ItemTree 2020-06-24 16:54:21 +02:00
Jonas Schievink
94169ee504 ItemTree: Use more boxed slices 2020-06-24 16:54:21 +02:00
Jonas Schievink
abdba92334 Don't allocate empty generics 2020-06-24 16:54:21 +02:00
Jonas Schievink
43cad21623 Don't allocate common visibilities 2020-06-24 16:54:20 +02:00
Jonas Schievink
16fd4dabb7 Remove file id from item tree
It's not needed, and `source` is only used by tests anyways
2020-06-24 16:53:56 +02:00
Jonas Schievink
c019002d17 Slightly reduce ItemTree memory footprint 2020-06-24 16:53:56 +02:00
Jonas Schievink
f9a1a9cd3c Merge item tree traits
The Source trait isn't needed anymore since we no longer merge
extern crate items with use items.
2020-06-24 16:53:56 +02:00
Jonas Schievink
b5fd02d93c Generate ModItem via macro 2020-06-24 16:53:56 +02:00
Jonas Schievink
20ff1cdcfb Address more comments 2020-06-24 16:53:56 +02:00
Jonas Schievink
a0ad457575 if let else -> match 2020-06-24 16:53:56 +02:00
Jonas Schievink
ae7a296c85 Unify and test attribute handling 2020-06-24 16:53:56 +02:00
Jonas Schievink
689e147c9d Collect inner items in expression macros 2020-06-24 16:53:54 +02:00
Jonas Schievink
ffa0435050 Make generics and attr queries use ItemTree
Now it's fast
2020-06-24 16:53:16 +02:00
Jonas Schievink
19586bc5c6 Record HirFileId's in profiler 2020-06-24 16:53:16 +02:00
Jonas Schievink
1fbe21a545 Make remaining item data queries use item tree 2020-06-24 16:53:16 +02:00
Jonas Schievink
4b03b39d5b draw the rest of the owl 2020-06-24 16:53:16 +02:00
Jonas Schievink
b94caeb88b ItemTree: Make clonable and add AST access 2020-06-24 16:53:16 +02:00
Jonas Schievink
c12f7b610b Lower generics 2020-06-24 16:53:16 +02:00
Jonas Schievink
864b650f92 ItemTree: use a newtyped ID 2020-06-24 16:53:16 +02:00
Jonas Schievink
278556f9fe Move ItemTree lowering into its own module 2020-06-24 16:53:16 +02:00
Jonas Schievink
f9e5ba7d40 Remove now-broken incremental test
The ItemTree tracks impl and trait items, so the CrateDefMap now needs
recomputing when those change
2020-06-24 16:53:16 +02:00
Jonas Schievink
0e2602f75e Remove raw item query 2020-06-24 16:53:16 +02:00
Jonas Schievink
7054e89d18 Fix test 2020-06-24 16:53:16 +02:00
Jonas Schievink
9d24412929 Move collector 2020-06-24 16:53:14 +02:00
Jonas Schievink
f9417bcf49 Draw the rest of the owl 2020-06-24 16:52:37 +02:00
Jonas Schievink
e24de2007f collector changes WIP 2020-06-24 16:52:37 +02:00
Jonas Schievink
696a7a5a41 lower traits 2020-06-24 16:52:37 +02:00
Jonas Schievink
34bc80650b Hook up query, add impls, lower moar 2020-06-24 16:52:37 +02:00
Aleksey Kladov
1d75d11d6c Start item tree 2020-06-24 16:52:37 +02:00
Paul Daniel Faria
43c6f6c039 Fix formatting issue with glob shadow test 2020-06-24 08:50:59 -04:00
Paul Daniel Faria
dfd79907b8 Use a macro in push_res to simplify code, simplify glob_shadowed_def assertion 2020-06-24 08:20:41 -04:00
Paul Daniel Faria
38af81f183 Account for updated module ids when determining whether a resolution is "changed" 2020-06-23 22:10:01 -04:00
Aleksey Kladov
d016cb4867 Use only one code-path for parsing fixtures
This removes leading newlines everywhere, shifting all ranges in tests
by one
2020-06-24 00:48:38 +02:00
Aleksey Kladov
6996ec860b Drop rarely used fixture functionality 2020-06-23 18:37:26 +02:00
Aleksey Kladov
dad1333b48 New VFS 2020-06-23 17:51:06 +02:00
Jonas Schievink
500d8b2f60 Handle bindings after @ in patterns 2020-06-21 15:19:38 +02:00
bors[bot]
04d64267de
Merge #4947
4947: Replace `impls_in_trait` query with smarter use of `CrateImplDefs` r=matklad a=jonas-schievink

`impls_in_trait` was allocating a whopping ~400 MB of RAM when running analysis-stats on r-a itself.

Remove it, instead adding a query that computes a summary `CrateImplDefs` map for all transitive dependencies. This can probably still be made more efficient, but this already reduces the peak memory usage by 25% without much performance impact on analysis-stats.

**Before**:

```
Total: 34.962107188s, 2083mb allocated 2141mb resident
   422mb ImplsForTraitQuery (deps)
   250mb CrateDefMapQueryQuery
   147mb MacroArgQuery
   140mb TraitSolveQuery (deps)
    68mb InferQueryQuery (deps)
    62mb ImplDatumQuery (deps)
```

**After**:

```
Total: 35.261100358s, 1520mb allocated 1569mb resident
   250mb CrateDefMapQueryQuery
   147mb MacroArgQuery
   144mb TraitSolveQuery (deps)
    68mb InferQueryQuery (deps)
    61mb ImplDatumQuery (deps)
    45mb BodyQuery
    45mb ImplDatumQuery
```

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-06-20 22:14:21 +00:00
Florian Diebold
584bddef0c Don't panic on crates depending on themselves
Fixes #3883.
2020-06-19 18:38:03 +02:00
Jonas Schievink
ebd8233b3e Replace impls_in_trait with CrateImplDefs 2020-06-19 01:29:34 +02:00
Aleksey Kladov
42be05a335 Simplify 2020-06-18 16:02:45 +02:00