1
Fork 0

Remove ArenaCacheSelector for visible_parent_map query.

Optimize visible_parent_map to use LRC to prevent unnecessary cloning
This commit is contained in:
Alik Aslanyan 2021-12-21 22:31:23 +04:00
parent 8ad3c1dd1d
commit 852dea89b2
No known key found for this signature in database
GPG key ID: 7FE6FD5D5BC4CCF6
2 changed files with 2 additions and 3 deletions

View file

@ -360,7 +360,7 @@ pub fn provide(providers: &mut Providers) {
visible_parent_map.entry(child).or_insert(parent); visible_parent_map.entry(child).or_insert(parent);
} }
visible_parent_map Lrc::new(visible_parent_map)
}, },
dependency_formats: |tcx, ()| Lrc::new(crate::dependency_format::calculate(tcx)), dependency_formats: |tcx, ()| Lrc::new(crate::dependency_format::calculate(tcx)),

View file

@ -1552,8 +1552,7 @@ rustc_queries! {
desc { "calculating the missing lang items in a crate" } desc { "calculating the missing lang items in a crate" }
separate_provide_extern separate_provide_extern
} }
query visible_parent_map(_: ()) -> DefIdMap<DefId> { query visible_parent_map(_: ()) -> Lrc<DefIdMap<DefId>> {
storage(ArenaCacheSelector<'tcx>)
desc { "calculating the visible parent map" } desc { "calculating the visible parent map" }
} }
query trimmed_def_paths(_: ()) -> FxHashMap<DefId, Symbol> { query trimmed_def_paths(_: ()) -> FxHashMap<DefId, Symbol> {