@@ -266,14 +266,14 @@ pub fn partition<'a, 'tcx, I>(scx: &SharedCrateContext<'a, 'tcx>,
266
266
let mut initial_partitioning = place_root_translation_items ( scx,
267
267
trans_items) ;
268
268
269
- debug_dump ( tcx , "INITIAL PARTITONING:" , initial_partitioning. codegen_units . iter ( ) ) ;
269
+ debug_dump ( scx , "INITIAL PARTITONING:" , initial_partitioning. codegen_units . iter ( ) ) ;
270
270
271
271
// If the partitioning should produce a fixed count of codegen units, merge
272
272
// until that count is reached.
273
273
if let PartitioningStrategy :: FixedUnitCount ( count) = strategy {
274
274
merge_codegen_units ( & mut initial_partitioning, count, & tcx. crate_name [ ..] ) ;
275
275
276
- debug_dump ( tcx , "POST MERGING:" , initial_partitioning. codegen_units . iter ( ) ) ;
276
+ debug_dump ( scx , "POST MERGING:" , initial_partitioning. codegen_units . iter ( ) ) ;
277
277
}
278
278
279
279
// In the next step, we use the inlining map to determine which addtional
@@ -283,7 +283,7 @@ pub fn partition<'a, 'tcx, I>(scx: &SharedCrateContext<'a, 'tcx>,
283
283
let post_inlining = place_inlined_translation_items ( initial_partitioning,
284
284
inlining_map) ;
285
285
286
- debug_dump ( tcx , "POST INLINING:" , post_inlining. 0 . iter ( ) ) ;
286
+ debug_dump ( scx , "POST INLINING:" , post_inlining. 0 . iter ( ) ) ;
287
287
288
288
// Finally, sort by codegen unit name, so that we get deterministic results
289
289
let mut result = post_inlining. 0 ;
@@ -551,7 +551,7 @@ fn numbered_codegen_unit_name(crate_name: &str, index: usize) -> InternedString
551
551
index) [ ..] )
552
552
}
553
553
554
- fn debug_dump < ' a , ' b , ' tcx , I > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
554
+ fn debug_dump < ' a , ' b , ' tcx , I > ( scx : & SharedCrateContext < ' a , ' tcx > ,
555
555
label : & str ,
556
556
cgus : I )
557
557
where I : Iterator < Item =& ' b CodegenUnit < ' tcx > > ,
@@ -560,10 +560,21 @@ fn debug_dump<'a, 'b, 'tcx, I>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
560
560
if cfg ! ( debug_assertions) {
561
561
debug ! ( "{}" , label) ;
562
562
for cgu in cgus {
563
+ let symbol_map = SymbolMap :: build ( scx, cgu. items
564
+ . iter ( )
565
+ . map ( |( & trans_item, _) | trans_item) ) ;
563
566
debug ! ( "CodegenUnit {}:" , cgu. name) ;
564
567
565
568
for ( trans_item, linkage) in & cgu. items {
566
- debug ! ( " - {} [{:?}]" , trans_item. to_string( tcx) , linkage) ;
569
+ let symbol_name = symbol_map. get_or_compute ( scx, * trans_item) ;
570
+ let symbol_hash_start = symbol_name. rfind ( 'h' ) ;
571
+ let symbol_hash = symbol_hash_start. map ( |i| & symbol_name[ i ..] )
572
+ . unwrap_or ( "<no hash>" ) ;
573
+
574
+ debug ! ( " - {} [{:?}] [{}]" ,
575
+ trans_item. to_string( scx. tcx( ) ) ,
576
+ linkage,
577
+ symbol_hash) ;
567
578
}
568
579
569
580
debug ! ( "" ) ;
0 commit comments