@@ -248,7 +248,8 @@ where
248
248
}
249
249
let size_estimate = mono_item. size_estimate ( cx. tcx ) ;
250
250
251
- cgu. items_mut ( ) . insert ( mono_item, MonoItemData { linkage, visibility, size_estimate } ) ;
251
+ cgu. items_mut ( )
252
+ . insert ( mono_item, MonoItemData { inlined : false , linkage, visibility, size_estimate } ) ;
252
253
253
254
// Get all inlined items that are reachable from `mono_item` without
254
255
// going via another root item. This includes drop-glue, functions from
@@ -263,6 +264,7 @@ where
263
264
for inlined_item in reachable_inlined_items {
264
265
// This is a CGU-private copy.
265
266
cgu. items_mut ( ) . entry ( inlined_item) . or_insert_with ( || MonoItemData {
267
+ inlined : true ,
266
268
linkage : Linkage :: Internal ,
267
269
visibility : Visibility :: Default ,
268
270
size_estimate : inlined_item. size_estimate ( cx. tcx ) ,
@@ -870,19 +872,16 @@ fn debug_dump<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx>, label: &str, cgus: &[CodegenUnit<
870
872
all_cgu_sizes. push ( cgu. size_estimate ( ) ) ;
871
873
872
874
for ( item, data) in cgu. items ( ) {
873
- match item. instantiation_mode ( tcx) {
874
- InstantiationMode :: GloballyShared { .. } => {
875
- root_items += 1 ;
876
- root_size += data. size_estimate ;
877
- }
878
- InstantiationMode :: LocalCopy => {
879
- if inlined_items. insert ( item) {
880
- unique_inlined_items += 1 ;
881
- unique_inlined_size += data. size_estimate ;
882
- }
883
- placed_inlined_items += 1 ;
884
- placed_inlined_size += data. size_estimate ;
875
+ if !data. inlined {
876
+ root_items += 1 ;
877
+ root_size += data. size_estimate ;
878
+ } else {
879
+ if inlined_items. insert ( item) {
880
+ unique_inlined_items += 1 ;
881
+ unique_inlined_size += data. size_estimate ;
885
882
}
883
+ placed_inlined_items += 1 ;
884
+ placed_inlined_size += data. size_estimate ;
886
885
}
887
886
}
888
887
}
@@ -937,10 +936,7 @@ fn debug_dump<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx>, label: &str, cgus: &[CodegenUnit<
937
936
let symbol_name = item. symbol_name ( tcx) . name ;
938
937
let symbol_hash_start = symbol_name. rfind ( 'h' ) ;
939
938
let symbol_hash = symbol_hash_start. map_or ( "<no hash>" , |i| & symbol_name[ i..] ) ;
940
- let kind = match item. instantiation_mode ( tcx) {
941
- InstantiationMode :: GloballyShared { .. } => "root" ,
942
- InstantiationMode :: LocalCopy => "inlined" ,
943
- } ;
939
+ let kind = if !data. inlined { "root" } else { "inlined" } ;
944
940
let size = data. size_estimate ;
945
941
let _ = with_no_trimmed_paths ! ( writeln!(
946
942
s,
0 commit comments