Skip to content

Commit 25d8e13

Browse files
committed
Print CGU reuse statistics in -Zprint-mono-items
1 parent 07b7dc9 commit 25d8e13

File tree

1 file changed

+5
-0
lines changed
  • compiler/rustc_codegen_ssa/src

1 file changed

+5
-0
lines changed

compiler/rustc_codegen_ssa/src/base.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,11 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
735735
crate::assert_module_sources::assert_module_sources(tcx, &|cgu_reuse_tracker| {
736736
for (i, cgu) in codegen_units.iter().enumerate() {
737737
let cgu_reuse = cgu_reuse[i];
738+
739+
if tcx.sess.opts.unstable_opts.print_mono_items {
740+
println!("CGU_REUSE {} {cgu_reuse}", cgu.name());
741+
}
742+
738743
cgu_reuse_tracker.set_actual_reuse(cgu.name().as_str(), cgu_reuse);
739744
}
740745
});

0 commit comments

Comments
 (0)