about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/queries.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_interface/src/queries.rs')
-rw-r--r--compiler/rustc_interface/src/queries.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs
index cfd4304e893..5f00d7a76b2 100644
--- a/compiler/rustc_interface/src/queries.rs
+++ b/compiler/rustc_interface/src/queries.rs
@@ -121,6 +121,18 @@ impl<'tcx> Queries<'tcx> {
         self.global_ctxt()?.enter(|tcx| {
             let ongoing_codegen = passes::start_codegen(&*self.compiler.codegen_backend, tcx)?;
 
+            // This must run after monomorphization so that all generic types
+            // have been instantiated.
+            if tcx.sess.opts.unstable_opts.print_type_sizes {
+                tcx.sess.code_stats.print_type_sizes();
+            }
+
+            if tcx.sess.opts.unstable_opts.print_vtable_sizes {
+                let crate_name = tcx.crate_name(LOCAL_CRATE);
+
+                tcx.sess.code_stats.print_vtable_sizes(crate_name);
+            }
+
             Ok(Linker {
                 dep_graph: tcx.dep_graph.clone(),
                 output_filenames: tcx.output_filenames(()).clone(),