diff options
| author | bors <bors@rust-lang.org> | 2023-06-14 11:24:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-06-14 11:24:42 +0000 |
| commit | 7b0eac438ace0ba305b4633328b00474fbbf5120 (patch) | |
| tree | 9517105c6d97bf97c08d6c114e9183b331952877 /compiler/rustc_driver_impl/src | |
| parent | 3ed2a10d173d6c2e0232776af338ca7d080b1cd4 (diff) | |
| parent | af4631ad6e16679243a36487431afde477f7d552 (diff) | |
| download | rust-7b0eac438ace0ba305b4633328b00474fbbf5120.tar.gz rust-7b0eac438ace0ba305b4633328b00474fbbf5120.zip | |
Auto merge of #112400 - WaffleLapkin:vtable_stats, r=compiler-errors
Collect VTable stats & add `-Zprint-vtable-sizes` This is a bit hacky/buggy, but I'm not entirely sure how to fix it, so I want to ask reviewers for help... To try this, use either of those: - `cargo clean && RUSTFLAGS="-Zprint-vtable-sizes" cargo +toolchain b` - `cargo clean && cargo rustc +toolchain -Zprint-vtable-sizes` - `rustc +toolchain -Zprint-vtable-sizes ./file.rs`
Diffstat (limited to 'compiler/rustc_driver_impl/src')
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 7 |
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)) })?; |
