@@ -128,7 +128,7 @@ impl<'tcx> Partition<'tcx> for Partitioner {
128
128
&mut self,
129
129
cx: &PartitioningCx<'_, 'tcx>,
130
130
mono_items: &mut I,
131
- ) -> (Vec<CodegenUnit< 'tcx>>, FxHashSet<MonoItem<'tcx>>, FxHashSet<MonoItem<'tcx>>)
131
+ ) -> PlacedRootMonoItems< 'tcx>
132
132
where
133
133
I: Iterator<Item = MonoItem<'tcx>>,
134
134
{
@@ -188,12 +188,18 @@ struct PartitioningCx<'a, 'tcx> {
188
188
inlining_map: &'a InliningMap<'tcx>,
189
189
}
190
190
191
+ pub struct PlacedRootMonoItems<'tcx> {
192
+ codegen_units: Vec<CodegenUnit<'tcx>>,
193
+ roots: FxHashSet<MonoItem<'tcx>>,
194
+ internalization_candidates: FxHashSet<MonoItem<'tcx>>,
195
+ }
196
+
191
197
trait Partition<'tcx> {
192
198
fn place_root_mono_items<I>(
193
199
&mut self,
194
200
cx: &PartitioningCx<'_, 'tcx>,
195
201
mono_items: &mut I,
196
- ) -> (Vec<CodegenUnit< 'tcx>>, FxHashSet<MonoItem<'tcx>>, FxHashSet<MonoItem<'tcx>>)
202
+ ) -> PlacedRootMonoItems< 'tcx>
197
203
where
198
204
I: Iterator<Item = MonoItem<'tcx>>;
199
205
@@ -247,7 +253,7 @@ where
247
253
// In the first step, we place all regular monomorphizations into their
248
254
// respective 'home' codegen unit. Regular monomorphizations are all
249
255
// functions and statics defined in the local crate.
250
- let ( mut codegen_units, roots, internalization_candidates) = {
256
+ let PlacedRootMonoItems { mut codegen_units, roots, internalization_candidates } = {
251
257
let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_place_roots");
252
258
partitioner.place_root_mono_items(cx, mono_items)
253
259
};
0 commit comments