Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Id-ify Ty::Adt | Aleksey Kladov | 2019-11-26 | 1 | -0/+4 |
| | |||||
* | Introduce hir::Type | Aleksey Kladov | 2019-11-26 | 1 | -0/+10 |
| | | | | It should provide a convenient API over more low-level Ty | ||||
* | :arrow_up: salsa | Aleksey Kladov | 2019-11-26 | 1 | -1/+3 |
| | |||||
* | Fixme for union fields | Aleksey Kladov | 2019-11-25 | 2 | -0/+6 |
| | |||||
* | Fix hir for ast::UnionDef | Aleksey Kladov | 2019-11-25 | 9 | -46/+62 |
| | |||||
* | Merge #2396 | bors[bot] | 2019-11-24 | 1 | -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 inference | Aleksey Kladov | 2019-11-24 | 1 | -6/+7 |
| | | |||||
* | | Implement HasModule for AdtId | Aleksey Kladov | 2019-11-24 | 2 | -9/+13 |
|/ | |||||
* | Simplify ADT fields | Aleksey Kladov | 2019-11-24 | 1 | -3/+11 |
| | |||||
* | hir_def is fully doc'ed! | Aleksey Kladov | 2019-11-24 | 3 | -5/+8 |
| | |||||
* | Docs | Aleksey Kladov | 2019-11-24 | 2 | -2/+4 |
| | |||||
* | Don't redo field resolution in the IDE | Aleksey Kladov | 2019-11-24 | 1 | -1/+1 |
| | |||||
* | Simplify | Aleksey Kladov | 2019-11-24 | 4 | -26/+10 |
| | |||||
* | Cleanup nameres | Aleksey Kladov | 2019-11-24 | 4 | -33/+17 |
| | |||||
* | Use Trace in raw_items | Aleksey Kladov | 2019-11-24 | 3 | -29/+39 |
| | |||||
* | Some docs | Aleksey Kladov | 2019-11-24 | 4 | -11/+18 |
| | |||||
* | Cleanup | Aleksey Kladov | 2019-11-24 | 6 | -19/+14 |
| | |||||
* | Reduce visibility | Aleksey Kladov | 2019-11-24 | 2 | -8/+11 |
| | |||||
* | Nicer API for attrs | Aleksey Kladov | 2019-11-24 | 3 | -31/+37 |
| | |||||
* | Slightly reduce code duplication | Aleksey Kladov | 2019-11-24 | 3 | -33/+30 |
| | |||||
* | Simplify | Aleksey Kladov | 2019-11-24 | 2 | -19/+5 |
| | |||||
* | Simplify | Aleksey Kladov | 2019-11-24 | 1 | -15/+0 |
| | |||||
* | Switch to StaticLoc for statics | Aleksey Kladov | 2019-11-24 | 8 | -14/+46 |
| | |||||
* | Pull macro up | Aleksey Kladov | 2019-11-24 | 1 | -14/+1 |
| | |||||
* | Push poison_macros down | Aleksey Kladov | 2019-11-24 | 2 | -25/+28 |
| | |||||
* | Reduce visbility | Aleksey Kladov | 2019-11-24 | 1 | -10/+10 |
| | |||||
* | Move ModuleSource back to hir | Aleksey Kladov | 2019-11-23 | 2 | -74/+6 |
| | |||||
* | Privatise nameres | Aleksey Kladov | 2019-11-23 | 6 | -9/+11 |
| | |||||
* | Rename CrateModuleId | Aleksey Kladov | 2019-11-23 | 7 | -51/+51 |
| | |||||
* | Move ImportId | Aleksey Kladov | 2019-11-23 | 4 | -24/+22 |
| | |||||
* | Cleanup imports | Aleksey Kladov | 2019-11-23 | 1 | -10/+10 |
| | |||||
* | Get rid of DefDatabase2 | Aleksey Kladov | 2019-11-23 | 19 | -128/+118 |
| | |||||
* | Move docs to hir_def | Aleksey Kladov | 2019-11-23 | 3 | -0/+75 |
| | |||||
* | Move lang_items to hir_def | Aleksey Kladov | 2019-11-23 | 3 | -3/+134 |
| | |||||
* | Use attrs rather than syntax for lang items | Aleksey Kladov | 2019-11-23 | 2 | -8/+20 |
| | |||||
* | Move attrs query to hir_def | Aleksey Kladov | 2019-11-23 | 4 | -7/+129 |
| | |||||
* | More principled sources for enums and fields | Aleksey Kladov | 2019-11-22 | 3 | -40/+167 |
| | |||||
* | Uniformalize naming | Aleksey Kladov | 2019-11-22 | 1 | -15/+10 |
| | |||||
* | Move const&static date to hir_def | Aleksey Kladov | 2019-11-22 | 2 | -5/+36 |
| | |||||
* | Make ImplData's fields public | Aleksey Kladov | 2019-11-22 | 1 | -22/+8 |
| | |||||
* | Move data to a single file | Aleksey Kladov | 2019-11-22 | 7 | -248/+208 |
| | |||||
* | Move FunctionData to hir_def | Aleksey Kladov | 2019-11-22 | 3 | -1/+68 |
| | |||||
*-. | Merge #2348 #2352 | bors[bot] | 2019-11-22 | 3 | -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_def | Aleksey Kladov | 2019-11-22 | 3 | -1/+33 |
| |/ | |||||
* / | Encapsulate Attrs | Aleksey Kladov | 2019-11-22 | 3 | -29/+45 |
|/ | |||||
* | Fix test mark placement | Aleksey Kladov | 2019-11-21 | 2 | -2/+2 |
| | |||||
* | Reduce visibility | Aleksey Kladov | 2019-11-21 | 1 | -41/+37 |
| | |||||
* | Resimplify | Aleksey Kladov | 2019-11-21 | 1 | -23/+6 |
| | |||||
* | Restore a mark | Aleksey Kladov | 2019-11-21 | 3 | -1/+20 |
| | |||||
* | Move resolver to hir_def | Aleksey Kladov | 2019-11-21 | 2 | -0/+609 |
| |