about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl/src/lib.rs
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2023-05-17 12:28:04 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2023-06-12 15:58:35 +0000
commitf2545fb22554eb1b04528d490c681e583fdc31d0 (patch)
treeea8549a633134a21e24d3d44a881a025d0fa229a /compiler/rustc_driver_impl/src/lib.rs
parentcb882fa998571e8a7ec1c06bb5d9dd9bc3423629 (diff)
downloadrust-f2545fb22554eb1b04528d490c681e583fdc31d0.tar.gz
rust-f2545fb22554eb1b04528d490c681e583fdc31d0.zip
Collect VTable stats & add `-Zprint-vtable-sizes`
Diffstat (limited to 'compiler/rustc_driver_impl/src/lib.rs')
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index 5b75205442b..f8dda23ef9c 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -430,6 +430,13 @@ fn run_compiler(
                 sess.code_stats.print_type_sizes();
             }
 
+            if sess.opts.unstable_opts.print_vtable_sizes {
+                let crate_name =
+                    compiler.session().opts.crate_name.as_deref().unwrap_or("<UNKNOWN_CRATE>");
+
+                sess.code_stats.print_vtable_sizes(crate_name);
+            }
+
             let linker = queries.linker()?;
             Ok(Some(linker))
         })?;