Skip to content

Commit 31851d4

Browse files
committed
Add -Zdump-mir-exclude-alloc-bytes
1 parent 4bc39f0 commit 31851d4

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

compiler/rustc_interface/src/tests.rs

+1
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

+3
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

+2
Original file line numberDiff line numberDiff line change
@@ -1662,6 +1662,8 @@ options! {
16621662
(default: no)"),
16631663
dump_mir_dir: String = ("mir_dump".to_string(), parse_string, [UNTRACKED],
16641664
"the directory the MIR is dumped into (default: `mir_dump`)"),
1665+
dump_mir_exclude_alloc_bytes: bool = (false, parse_bool, [UNTRACKED],
1666+
"exclude the raw bytes of allocations when dumping MIR (used in tests) (default: no)"),
16651667
dump_mir_exclude_pass_number: bool = (false, parse_bool, [UNTRACKED],
16661668
"exclude the pass number when dumping MIR (used in tests) (default: no)"),
16671669
dump_mir_graphviz: bool = (false, parse_bool, [UNTRACKED],

0 commit comments

Comments
 (0)