about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlik Aslanyan <inline0@protonmail.com>2021-12-21 22:31:23 +0400
committerAlik Aslanyan <inline0@protonmail.com>2021-12-21 22:40:21 +0400
commit852dea89b2289fe101f2bbd807c0abdd09902e08 (patch)
tree9f6ef5d98a06a6dd7292f3bd7215e30f0912a056
parent8ad3c1dd1d47f9ce7dfdf4a14c70c67e1790b0f5 (diff)
downloadrust-852dea89b2289fe101f2bbd807c0abdd09902e08.tar.gz
rust-852dea89b2289fe101f2bbd807c0abdd09902e08.zip
Remove ArenaCacheSelector for visible_parent_map query.
Optimize visible_parent_map to use LRC to prevent unnecessary cloning
-rw-r--r--compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs2
-rw-r--r--compiler/rustc_middle/src/query/mod.rs3
2 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
index 4e5d21049a0..3f3b83cf795 100644
--- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
+++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
@@ -360,7 +360,7 @@ pub fn provide(providers: &mut Providers) {
                 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)),
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
index ad3f61d0784..81602dc9d61 100644
--- a/compiler/rustc_middle/src/query/mod.rs
+++ b/compiler/rustc_middle/src/query/mod.rs
@@ -1552,8 +1552,7 @@ rustc_queries! {
         desc { "calculating the missing lang items in a crate" }
         separate_provide_extern
     }
-    query visible_parent_map(_: ()) -> DefIdMap<DefId> {
-        storage(ArenaCacheSelector<'tcx>)
+    query visible_parent_map(_: ()) -> Lrc<DefIdMap<DefId>> {
         desc { "calculating the visible parent map" }
     }
     query trimmed_def_paths(_: ()) -> FxHashMap<DefId, Symbol> {