use a different filename for original and promoted MIRs

This commit is contained in:
Ariel Ben-Yehuda 2016-06-16 16:52:20 +03:00
parent a479a6a7a6
commit 63cdd7ab50

View File

@ -61,8 +61,13 @@ pub fn dump_mir<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
return;
}
let file_name = format!("rustc.node{}.{}.{}.mir",
node_id, pass_name, disambiguator);
let promotion_id = match src {
MirSource::Promoted(_, id) => format!("-promoted{}", id),
_ => String::new()
};
let file_name = format!("rustc.node{}{}.{}.{}.mir",
node_id, promotion_id, pass_name, disambiguator);
let _ = fs::File::create(&file_name).and_then(|mut file| {
try!(writeln!(file, "// MIR for `{}`", node_path));
try!(writeln!(file, "// node_id = {}", node_id));