Commit graph

300 commits

Author SHA1 Message Date
Florian Diebold
2906d188c2 Cleanup 2020-01-11 23:33:04 +01:00
Florian Diebold
38cd9f0c94 Handle cycles 2020-01-11 23:33:04 +01:00
Florian Diebold
b1325488ec Use query for importable locations 2020-01-11 23:33:04 +01:00
Florian Diebold
947eec7b87 Use super, don't use private imports 2020-01-11 23:33:04 +01:00
Florian Diebold
df9d3bd25e Use shortest path 2020-01-11 23:33:04 +01:00
Florian Diebold
1ea2b475a9 handle most cases 2020-01-11 23:33:04 +01:00
Florian Diebold
b62292e8f9 basics working 2020-01-11 23:33:04 +01:00
Florian Diebold
2c50f996b6 more WIP 2020-01-11 23:33:04 +01:00
Florian Diebold
22b412f1a9 find_path WIP 2020-01-11 23:33:04 +01:00
Michal Terepeta
2e2e443560 Add _query suffix to compute_crate_def_map for consistency
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 14:20:24 +01:00
Michal Terepeta
7cd6f12926 Split crate_def_map into two methods
This change:

  - introduces `compute_crate_def_map` query and renames
    `CrateDefMap::crate_def_map_query` for consistency,

  - annotates `crate_def_map` as `salsa::transparent` and adds a
    top-level `crate_def_map` wrapper function around that starts the
    profiler and immediately calls into `compute_crate_def_map` query.

This allows us to better understand where we spent the time, in
particular, how much is spent in the recomputaiton and how much in
salsa.

Example output (where we don't actually re-compute anything, but the
query still takes a non-trivial amount of time):

```
  211ms - handle_inlay_hints
      150ms - get_inlay_hints
          150ms - SourceAnalyzer::new
               65ms - def_with_body_from_child_node
                   65ms - analyze_container
                       65ms - analyze_container
                           65ms - Module::from_definition
                               65ms - Module::from_file
                                   65ms - crate_def_map
                                        1ms - parse_macro_query (6 calls)
                                        0ms - raw_items_query (1 calls)
                                       64ms - ???
```

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 13:59:46 +01:00
Michal Terepeta
84e2e173ee Remove a duplicate line in collect_defs
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 12:40:50 +01:00
Emil Lauridsen
8280795a85 Remove unused hard-coded paths 2019-12-29 17:39:44 +01:00
Emil Lauridsen
fc3ab03af7 Add helpers for unpacking lang items 2019-12-29 17:38:37 +01:00
bors[bot]
523b4cbc60
Merge #2650
2650: Add macro call support for SourceAnalyzer::type_of r=matklad a=edwin0cheng



Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-12-29 15:02:27 +00:00
Aleksey Kladov
8f36f768e1 Don't add non-impl/trait containers to scope 2019-12-29 14:47:47 +01:00
Florian Diebold
9fd2c813ca visible_from -> is_visible_from 2019-12-27 11:25:04 +01:00
Florian Diebold
dfe95d735b Remove Arc from RawVisibility
Now that it's not used as a direct query return value anymore, it doesn't need
to be cheaply cloneable anymore.
2019-12-26 16:42:57 +01:00
Florian Diebold
04cf98f8a6 Fix cross-crate glob privacy handling 2019-12-26 16:31:38 +01:00
Florian Diebold
78111620a3 Remove visibility query, instead add struct field visibility to data
Methods should be handled the same, and for items the visibility will be in the
def map.
2019-12-26 16:23:40 +01:00
Florian Diebold
50ebff257d Rename ResolvedVisibility -> Visibility 2019-12-26 16:23:40 +01:00
Florian Diebold
e1a2961273 Rename Visibility -> RawVisibility 2019-12-26 16:23:40 +01:00
Florian Diebold
04e8eaa14b Handle privacy for modules 2019-12-26 16:23:40 +01:00
Florian Diebold
21359c3ab5 Take visibility into account for glob imports 2019-12-26 16:23:40 +01:00
Florian Diebold
8ac25f119e Keep track of visibility during def collection 2019-12-26 16:23:40 +01:00
Florian Diebold
79c90b5641 Collect visibility of items during nameres 2019-12-26 16:23:40 +01:00
Florian Diebold
c31dae2aca Add doc comment 2019-12-26 16:23:40 +01:00
Florian Diebold
8aeaf93b9a Make enum variant fields public 2019-12-26 16:23:40 +01:00
Florian Diebold
1ce809d0fa Add logic for resolving and checking visibility 2019-12-26 16:23:40 +01:00
Florian Diebold
069bf55cca Add infrastructure for visibility on syntax and hir_def level 2019-12-26 16:23:40 +01:00
Edwin Cheng
208ad97fdc Remove AsyncOwner 2019-12-25 00:25:18 +08:00
Edwin Cheng
d0537cda9e Formatting 2019-12-24 20:30:39 +08:00
Edwin Cheng
0edb5b4a50 Implement infer await from async func 2019-12-24 19:45:28 +08:00
Edwin Cheng
12cc2ed557 Use pre-stored macro file 2019-12-23 21:56:10 +08:00
Edwin Cheng
16156d766d Add macro call support for type_of 2019-12-23 13:19:01 +08:00
Aleksey Kladov
e424545c0f Rudimentary name resolution for local items 2019-12-22 22:41:21 +01:00
Aleksey Kladov
7c405c0156 Simplify 2019-12-22 19:32:35 +01:00
Aleksey Kladov
007032f850 Refactor 2019-12-22 19:31:01 +01:00
Aleksey Kladov
baee746185 Share impl Scope between modules and blocks 2019-12-22 15:52:35 +01:00
Aleksey Kladov
6c3ddcfa50 Simplify 2019-12-22 15:37:53 +01:00
Aleksey Kladov
e8da7d4061 Remove unused parameters 2019-12-22 15:31:30 +01:00
Aleksey Kladov
558956c84b Remove import field 2019-12-22 15:28:55 +01:00
Aleksey Kladov
2c60f42825 Separate defs from imports 2019-12-22 15:21:48 +01:00
Aleksey Kladov
e69af85962 Refactor PerNs construction 2019-12-22 15:10:19 +01:00
Aleksey Kladov
fe38fffaa9 Minor rename 2019-12-22 15:04:31 +01:00
Aleksey Kladov
e903f58d29 More profiling 2019-12-21 19:44:08 +01:00
bors[bot]
f874d6c475
Merge #2637
2637: Optimize and profile r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-21 17:46:52 +00:00
Aleksey Kladov
d4b135f38c Optimize and profile 2019-12-21 18:46:21 +01:00
Aleksey Kladov
1a8f2aa024 Move LocalImportId 2019-12-21 17:34:28 +01:00
Aleksey Kladov
02f79e37ca Remove import source map 2019-12-21 17:26:28 +01:00