Skip to content

Commit 8355132

Browse files
committed
Move type size and vtable size printing to start_codegen
1 parent 21634cb commit 8355132

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Diff for: compiler/rustc_interface/src/passes.rs

+12
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,18 @@ pub(crate) fn start_codegen<'tcx>(
11251125
}
11261126
}
11271127

1128+
// This must run after monomorphization so that all generic types
1129+
// have been instantiated.
1130+
if tcx.sess.opts.unstable_opts.print_type_sizes {
1131+
tcx.sess.code_stats.print_type_sizes();
1132+
}
1133+
1134+
if tcx.sess.opts.unstable_opts.print_vtable_sizes {
1135+
let crate_name = tcx.crate_name(LOCAL_CRATE);
1136+
1137+
tcx.sess.code_stats.print_vtable_sizes(crate_name);
1138+
}
1139+
11281140
codegen
11291141
}
11301142

Diff for: compiler/rustc_interface/src/queries.rs

-12
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,6 @@ impl Linker {
127127
) -> Linker {
128128
let ongoing_codegen = passes::start_codegen(codegen_backend, tcx);
129129

130-
// This must run after monomorphization so that all generic types
131-
// have been instantiated.
132-
if tcx.sess.opts.unstable_opts.print_type_sizes {
133-
tcx.sess.code_stats.print_type_sizes();
134-
}
135-
136-
if tcx.sess.opts.unstable_opts.print_vtable_sizes {
137-
let crate_name = tcx.crate_name(LOCAL_CRATE);
138-
139-
tcx.sess.code_stats.print_vtable_sizes(crate_name);
140-
}
141-
142130
Linker {
143131
dep_graph: tcx.dep_graph.clone(),
144132
output_filenames: Arc::clone(tcx.output_filenames(())),

0 commit comments

Comments
 (0)