@@ -248,7 +248,8 @@ where
248248 }
249249 let size_estimate = mono_item. size_estimate ( cx. tcx ) ;
250250
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 } ) ;
252253
253254 // Get all inlined items that are reachable from `mono_item` without
254255 // going via another root item. This includes drop-glue, functions from
@@ -263,6 +264,7 @@ where
263264 for inlined_item in reachable_inlined_items {
264265 // This is a CGU-private copy.
265266 cgu. items_mut ( ) . entry ( inlined_item) . or_insert_with ( || MonoItemData {
267+ inlined : true ,
266268 linkage : Linkage :: Internal ,
267269 visibility : Visibility :: Default ,
268270 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<
870872 all_cgu_sizes. push ( cgu. size_estimate ( ) ) ;
871873
872874 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 ;
885882 }
883+ placed_inlined_items += 1 ;
884+ placed_inlined_size += data. size_estimate ;
886885 }
887886 }
888887 }
@@ -937,10 +936,7 @@ fn debug_dump<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx>, label: &str, cgus: &[CodegenUnit<
937936 let symbol_name = item. symbol_name ( tcx) . name ;
938937 let symbol_hash_start = symbol_name. rfind ( 'h' ) ;
939938 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" } ;
944940 let size = data. size_estimate ;
945941 let _ = with_no_trimmed_paths ! ( writeln!(
946942 s,
0 commit comments