Skip to content

Commit 63cdd7a

Browse files
author
Ariel Ben-Yehuda
committed
use a different filename for original and promoted MIRs
1 parent a479a6a commit 63cdd7a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/librustc_mir/pretty.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@ pub fn dump_mir<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
6161
return;
6262
}
6363

64-
let file_name = format!("rustc.node{}.{}.{}.mir",
65-
node_id, pass_name, disambiguator);
64+
let promotion_id = match src {
65+
MirSource::Promoted(_, id) => format!("-promoted{}", id),
66+
_ => String::new()
67+
};
68+
69+
let file_name = format!("rustc.node{}{}.{}.{}.mir",
70+
node_id, promotion_id, pass_name, disambiguator);
6671
let _ = fs::File::create(&file_name).and_then(|mut file| {
6772
try!(writeln!(file, "// MIR for `{}`", node_path));
6873
try!(writeln!(file, "// node_id = {}", node_id));

0 commit comments

Comments
 (0)