Skip to content

Commit

Permalink
Rollup merge of rust-lang#65175 - andjo403:partitioning, r=zackmdavis
Browse files Browse the repository at this point in the history
add more info in debug traces for gcu merging

to help in investigation of CGU partitioning problems e.g rust-lang#64913
  • Loading branch information
Centril authored Oct 9, 2019
2 parents 5bbdcb6 + 50932ea commit e27f029
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/librustc_mir/monomorphize/partitioning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ fn merge_codegen_units<'tcx>(
for (k, v) in smallest.items_mut().drain() {
second_smallest.items_mut().insert(k, v);
}
debug!("CodegenUnit {} merged in to CodegenUnit {}",
smallest.name(),
second_smallest.name());
}

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

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

debug!(" - {} [{:?}] [{}]",
debug!(" - {} [{:?}] [{}] estimated size {}",
mono_item.to_string(tcx, true),
linkage,
symbol_hash);
symbol_hash,
mono_item.size_estimate(tcx));
}

debug!("");
Expand Down

0 comments on commit e27f029

Please sign in to comment.