Skip to content

Commit db99e5a

Browse files
authored
Rollup merge of rust-lang#65175 - andjo403:partitioning, r=zackmdavis
add more info in debug traces for gcu merging to help in investigation of CGU partitioning problems e.g rust-lang#64913
2 parents ddcaded + 50932ea commit db99e5a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/librustc_mir/monomorphize/partitioning.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,9 @@ fn merge_codegen_units<'tcx>(
494494
for (k, v) in smallest.items_mut().drain() {
495495
second_smallest.items_mut().insert(k, v);
496496
}
497+
debug!("CodegenUnit {} merged in to CodegenUnit {}",
498+
smallest.name(),
499+
second_smallest.name());
497500
}
498501

499502
let cgu_name_builder = &mut CodegenUnitNameBuilder::new(tcx);
@@ -774,18 +777,19 @@ where
774777
if cfg!(debug_assertions) {
775778
debug!("{}", label);
776779
for cgu in cgus {
777-
debug!("CodegenUnit {}:", cgu.name());
780+
debug!("CodegenUnit {} estimated size {} :", cgu.name(), cgu.size_estimate());
778781

779782
for (mono_item, linkage) in cgu.items() {
780783
let symbol_name = mono_item.symbol_name(tcx).name.as_str();
781784
let symbol_hash_start = symbol_name.rfind('h');
782785
let symbol_hash = symbol_hash_start.map(|i| &symbol_name[i ..])
783786
.unwrap_or("<no hash>");
784787

785-
debug!(" - {} [{:?}] [{}]",
788+
debug!(" - {} [{:?}] [{}] estimated size {}",
786789
mono_item.to_string(tcx, true),
787790
linkage,
788-
symbol_hash);
791+
symbol_hash,
792+
mono_item.size_estimate(tcx));
789793
}
790794

791795
debug!("");

0 commit comments

Comments
 (0)