about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-06-07 09:24:51 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-06-07 10:27:00 +1000
commit1defd3076473699332e1b4c424d35f0dfb28c63b (patch)
tree7b964817947f7bfbdb640e4d93eb2fa92ceea2bc
parent8dbb3475b93a15cbd64e9b726a775ee2b31328a6 (diff)
downloadrust-1defd3076473699332e1b4c424d35f0dfb28c63b.tar.gz
rust-1defd3076473699332e1b4c424d35f0dfb28c63b.zip
Remove `PlacedRootMonoItems::roots`.
It's no longer used.
-rw-r--r--compiler/rustc_monomorphize/src/partitioning.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/compiler/rustc_monomorphize/src/partitioning.rs b/compiler/rustc_monomorphize/src/partitioning.rs
index 737c0b035e7..e3a226fd427 100644
--- a/compiler/rustc_monomorphize/src/partitioning.rs
+++ b/compiler/rustc_monomorphize/src/partitioning.rs
@@ -129,7 +129,6 @@ struct PlacedRootMonoItems<'tcx> {
     /// The codegen units, sorted by name to make things deterministic.
     codegen_units: Vec<CodegenUnit<'tcx>>,
 
-    roots: FxHashSet<MonoItem<'tcx>>,
     internalization_candidates: FxHashSet<MonoItem<'tcx>>,
 }
 
@@ -150,7 +149,7 @@ where
     // In the first step, we place all regular monomorphizations into their
     // respective 'home' codegen unit. Regular monomorphizations are all
     // functions and statics defined in the local crate.
-    let PlacedRootMonoItems { mut codegen_units, roots, internalization_candidates } = {
+    let PlacedRootMonoItems { mut codegen_units, internalization_candidates } = {
         let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_place_roots");
         place_root_mono_items(cx, mono_items)
     };
@@ -176,7 +175,7 @@ where
     // local functions the definition of which is marked with `#[inline]`.
     let mono_item_placements = {
         let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_place_inline_items");
-        place_inlined_mono_items(cx, &mut codegen_units, roots)
+        place_inlined_mono_items(cx, &mut codegen_units)
     };
 
     for cgu in &mut codegen_units {
@@ -244,7 +243,6 @@ fn place_root_mono_items<'tcx, I>(
 where
     I: Iterator<Item = MonoItem<'tcx>>,
 {
-    let mut roots = FxHashSet::default();
     let mut codegen_units = FxHashMap::default();
     let is_incremental_build = cx.tcx.sess.opts.incremental.is_some();
     let mut internalization_candidates = FxHashSet::default();
@@ -295,7 +293,6 @@ where
         }
 
         codegen_unit.items_mut().insert(mono_item, (linkage, visibility));
-        roots.insert(mono_item);
     }
 
     // Always ensure we have at least one CGU; otherwise, if we have a
@@ -308,7 +305,7 @@ where
     let mut codegen_units: Vec<_> = codegen_units.into_values().collect();
     codegen_units.sort_by(|a, b| a.name().as_str().cmp(b.name().as_str()));
 
-    PlacedRootMonoItems { codegen_units, roots, internalization_candidates }
+    PlacedRootMonoItems { codegen_units, internalization_candidates }
 }
 
 // This function requires the CGUs to be sorted by name on input, and ensures
@@ -416,7 +413,6 @@ enum MonoItemPlacement {
 fn place_inlined_mono_items<'tcx>(
     cx: &PartitioningCx<'_, 'tcx>,
     codegen_units: &mut [CodegenUnit<'tcx>],
-    _roots: FxHashSet<MonoItem<'tcx>>,
 ) -> FxHashMap<MonoItem<'tcx>, MonoItemPlacement> {
     for cgu in codegen_units.iter_mut() {
         // Collect all inlined items that need to be available in this codegen unit.