Make dump_mir_dir non-optional

This commit is contained in:
varkor 2018-01-14 20:02:07 +00:00
parent a22e71685a
commit 2ccc82e27e
3 changed files with 3 additions and 10 deletions

View File

@ -1172,7 +1172,7 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"emit noalias metadata for mutable references"),
dump_mir: Option<String> = (None, parse_opt_string, [UNTRACKED],
"dump MIR state at various points in translation"),
dump_mir_dir: Option<String> = (Some(String::from("mir_dump")), parse_opt_string, [UNTRACKED],
dump_mir_dir: String = (String::from("mir_dump"), parse_string, [UNTRACKED],
"the directory the MIR is dumped into"),
dump_mir_graphviz: bool = (false, parse_bool, [UNTRACKED],
"in addition to `.mir` files, create graphviz `.dot` files"),

View File

@ -407,10 +407,7 @@ fn dump_matched_mir_node<'a, 'tcx>(
result: &LivenessResult,
) {
let mut file_path = PathBuf::new();
if let Some(ref file_dir) = tcx.sess.opts.debugging_opts.dump_mir_dir {
let p = Path::new(file_dir);
file_path.push(p);
};
file_path.push(Path::new(&tcx.sess.opts.debugging_opts.dump_mir_dir));
let item_id = tcx.hir.as_local_node_id(source.def_id).unwrap();
let file_name = format!("rustc.node{}{}-liveness.mir", item_id, pass_name);
file_path.push(&file_name);

View File

@ -189,11 +189,7 @@ fn dump_path(
};
let mut file_path = PathBuf::new();
if let Some(ref file_dir) = tcx.sess.opts.debugging_opts.dump_mir_dir {
let p = Path::new(file_dir);
file_path.push(p);
};
file_path.push(Path::new(&tcx.sess.opts.debugging_opts.dump_mir_dir));
let item_name = tcx.hir
.def_path(source.def_id)