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