Skip to content

Commit b119781

Browse files
committed
Add -Zdump-mir-exclude-alloc-bytes
1 parent f8e5660 commit b119781

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

compiler/rustc_interface/src/tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ fn test_unstable_options_tracking_hash() {
683683
untracked!(dump_mir, Some(String::from("abc")));
684684
untracked!(dump_mir_dataflow, true);
685685
untracked!(dump_mir_dir, String::from("abc"));
686+
untracked!(dump_mir_exclude_alloc_bytes, true);
686687
untracked!(dump_mir_exclude_pass_number, true);
687688
untracked!(dump_mir_graphviz, true);
688689
untracked!(dump_mono_stats, SwitchWithOptPath::Enabled(Some("mono-items-dir/".into())));

compiler/rustc_middle/src/mir/pretty.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,9 @@ impl<'a, 'tcx, Prov: Provenance, Extra, Bytes: AllocBytes> std::fmt::Display
15211521
// We are done.
15221522
return write!(w, " {{}}");
15231523
}
1524+
if tcx.sess.opts.unstable_opts.dump_mir_exclude_alloc_bytes {
1525+
return write!(w, " {{ .. }}");
1526+
}
15241527
// Write allocation bytes.
15251528
writeln!(w, " {{")?;
15261529
write_allocation_bytes(tcx, alloc, w, " ")?;

compiler/rustc_session/src/options.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,8 @@ options! {
16471647
(default: no)"),
16481648
dump_mir_dir: String = ("mir_dump".to_string(), parse_string, [UNTRACKED],
16491649
"the directory the MIR is dumped into (default: `mir_dump`)"),
1650+
dump_mir_exclude_alloc_bytes: bool = (false, parse_bool, [UNTRACKED],
1651+
"exclude the raw bytes of allocations when dumping MIR (used in tests) (default: no)"),
16501652
dump_mir_exclude_pass_number: bool = (false, parse_bool, [UNTRACKED],
16511653
"exclude the pass number when dumping MIR (used in tests) (default: no)"),
16521654
dump_mir_graphviz: bool = (false, parse_bool, [UNTRACKED],

0 commit comments

Comments
 (0)