aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def
Commit message (Collapse)AuthorAgeFilesLines
* Merge #2396bors[bot]2019-11-241-6/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2396: Switch to variant-granularity field type inference r=flodiebold a=matklad r? @flodiebold Previously, we had a `ty` query for each field. This PR switcthes to a query per struct, which returns an `ArenaMap` with `Ty`s. I don't know which approach is better. What is bugging me about the original approach is that, if we do all queries on the "leaf" defs, in practice we get a ton of queries which repeatedly reach into the parent definition to compute module, resolver, etc. This *seems* wasteful (but I don't think this is really what causes any perf problems for us). At the same time, I've been looking at Kotlin, and they seem to use the general pattern of analyzing the *parent* definition, and storing info about children into a `BindingContext`. I don't really which way is preferable. I think I want to try this approach, where query granularity generally mirrors the data granularity. The primary motivation for me here is probably just hope that we can avoid adding a ton of helpers to a `StructField`, and maybe in general avoid the need to switch to a global `StructField`, using `LocalStructFieldId` most of the time internally. For external API (ie, for `ra_ide_api`), I think we should continue with fine-grained `StructField::ty` approach, which internally fetches the table for the whole struct and indexes into it. In terms of actual memory savings, the results are as follows: ``` This PR: 142kb FieldTypesQuery (deps) 38kb FieldTypesQuery Status Quo: 208kb TypeForFieldQuery (deps) 18kb TypeForFieldQuery ``` Note how the table itself occupies more than twice as much space! I don't have an explanation for this: a plausible hypothesis is that single-field structs are very common and for them the table is a pessimisation. THere's noticiable wallclock time difference. Co-authored-by: Aleksey Kladov <[email protected]>
| * Switch to variant-granularity field type inferenceAleksey Kladov2019-11-241-6/+7
| |
* | Implement HasModule for AdtIdAleksey Kladov2019-11-242-9/+13
|/
* Simplify ADT fieldsAleksey Kladov2019-11-241-3/+11
|
* hir_def is fully doc'ed!Aleksey Kladov2019-11-243-5/+8
|
* DocsAleksey Kladov2019-11-242-2/+4
|
* Don't redo field resolution in the IDEAleksey Kladov2019-11-241-1/+1
|
* SimplifyAleksey Kladov2019-11-244-26/+10
|
* Cleanup nameresAleksey Kladov2019-11-244-33/+17
|
* Use Trace in raw_itemsAleksey Kladov2019-11-243-29/+39
|
* Some docsAleksey Kladov2019-11-244-11/+18
|
* CleanupAleksey Kladov2019-11-246-19/+14
|
* Reduce visibilityAleksey Kladov2019-11-242-8/+11
|
* Nicer API for attrsAleksey Kladov2019-11-243-31/+37
|
* Slightly reduce code duplicationAleksey Kladov2019-11-243-33/+30
|
* SimplifyAleksey Kladov2019-11-242-19/+5
|
* SimplifyAleksey Kladov2019-11-241-15/+0
|
* Switch to StaticLoc for staticsAleksey Kladov2019-11-248-14/+46
|
* Pull macro upAleksey Kladov2019-11-241-14/+1
|
* Push poison_macros downAleksey Kladov2019-11-242-25/+28
|
* Reduce visbilityAleksey Kladov2019-11-241-10/+10
|
* Move ModuleSource back to hirAleksey Kladov2019-11-232-74/+6
|
* Privatise nameresAleksey Kladov2019-11-236-9/+11
|
* Rename CrateModuleIdAleksey Kladov2019-11-237-51/+51
|
* Move ImportIdAleksey Kladov2019-11-234-24/+22
|
* Cleanup importsAleksey Kladov2019-11-231-10/+10
|
* Get rid of DefDatabase2Aleksey Kladov2019-11-2319-128/+118
|
* Move docs to hir_defAleksey Kladov2019-11-233-0/+75
|
* Move lang_items to hir_defAleksey Kladov2019-11-233-3/+134
|
* Use attrs rather than syntax for lang itemsAleksey Kladov2019-11-232-8/+20
|
* Move attrs query to hir_defAleksey Kladov2019-11-234-7/+129
|
* More principled sources for enums and fieldsAleksey Kladov2019-11-223-40/+167
|
* Uniformalize namingAleksey Kladov2019-11-221-15/+10
|
* Move const&static date to hir_defAleksey Kladov2019-11-222-5/+36
|
* Make ImplData's fields publicAleksey Kladov2019-11-221-22/+8
|
* Move data to a single fileAleksey Kladov2019-11-227-248/+208
|
* Move FunctionData to hir_defAleksey Kladov2019-11-223-1/+68
|
*-. Merge #2348 #2352bors[bot]2019-11-223-1/+33
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2348: Add support for stringify! builtin macro r=matklad a=piotr-szpetkowski Refs #2212 First time ever contributing here, hopefully it's ok. 2352: Move TypeAlias to hir_def r=matklad a=matklad Co-authored-by: Piotr Szpetkowski <[email protected]> Co-authored-by: Aleksey Kladov <[email protected]>
| | * Move TypeAlias to hir_defAleksey Kladov2019-11-223-1/+33
| |/
* / Encapsulate AttrsAleksey Kladov2019-11-223-29/+45
|/
* Fix test mark placementAleksey Kladov2019-11-212-2/+2
|
* Reduce visibilityAleksey Kladov2019-11-211-41/+37
|
* ResimplifyAleksey Kladov2019-11-211-23/+6
|
* Restore a markAleksey Kladov2019-11-213-1/+20
|
* Move resolver to hir_defAleksey Kladov2019-11-212-0/+609
|
* Decouple ResolverAleksey Kladov2019-11-211-1/+8
|
* Simplify generic paramsAleksey Kladov2019-11-201-2/+1
|
* Move generic_params query to HIRAleksey Kladov2019-11-202-4/+31
|
* Move constants to new IDAleksey Kladov2019-11-206-54/+65
| | | | This allows us to get rid of trait item index
* Don't duplicate ContainerId typeAleksey Kladov2019-11-204-34/+27
|