Skip to content

Commit b376c50

Browse files
authored
Rollup merge of rust-lang#81861 - tmiasko:mir-bytes, r=wesleywiser
Show MIR bytes separately in -Zmeta-stats output The size of serialized MIR is substantial enough to deserve its own category.
2 parents 98aec15 + a14ec1c commit b376c50

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/rustc_metadata/src/rmeta/encoder.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,14 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
572572

573573
let tcx = self.tcx;
574574

575+
// Encode MIR.
576+
i = self.position();
577+
self.encode_mir();
578+
let mir_bytes = self.position() - i;
579+
575580
// Encode the items.
576581
i = self.position();
577582
self.encode_def_ids();
578-
self.encode_mir();
579583
self.encode_info_for_items();
580584
let item_bytes = self.position() - i;
581585

@@ -700,6 +704,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
700704
println!(" exp. symbols bytes: {}", exported_symbols_bytes);
701705
println!(" def-path table bytes: {}", def_path_table_bytes);
702706
println!(" proc-macro-data-bytes: {}", proc_macro_data_bytes);
707+
println!(" mir bytes: {}", mir_bytes);
703708
println!(" item bytes: {}", item_bytes);
704709
println!(" table bytes: {}", tables_bytes);
705710
println!(" hygiene bytes: {}", hygiene_bytes);

0 commit comments

Comments
 (0)