test: bool [TRACKED],
error_format: ErrorOutputType [UNTRACKED],
- mir_opt_level: usize [TRACKED],
// if Some, enable incremental compilation, using the given
// directory to store intermediate results
maybe_sysroot: None,
target_triple: host_triple().to_string(),
test: false,
- mir_opt_level: 1,
incremental: None,
debugging_opts: basic_debugging_options(),
prints: Vec::new(),
"print layout information for each type encountered"),
print_trans_items: Option<String> = (None, parse_opt_string, [UNTRACKED],
"print the result of the translation item collection pass"),
- mir_opt_level: Option<usize> = (None, parse_opt_uint, [TRACKED],
- "set the MIR optimization level (0-3)"),
+ mir_opt_level: usize = (1, parse_uint, [TRACKED],
+ "set the MIR optimization level (0-3, default: 1)"),
dump_mir: Option<String> = (None, parse_opt_string, [UNTRACKED],
"dump MIR state at various points in translation"),
dump_mir_dir: Option<String> = (None, parse_opt_string, [UNTRACKED],
let debugging_opts = build_debugging_options(matches, error_format);
- let mir_opt_level = debugging_opts.mir_opt_level.unwrap_or(1);
-
let mut output_types = BTreeMap::new();
if !debugging_opts.parse_only {
for list in matches.opt_strs("emit") {
maybe_sysroot: sysroot_opt,
target_triple: target,
test: test,
- mir_opt_level: mir_opt_level,
incremental: incremental,
debugging_opts: debugging_opts,
prints: prints,
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
opts = reference.clone();
- opts.debugging_opts.mir_opt_level = Some(1);
+ opts.debugging_opts.mir_opt_level = 3;
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
}
}
let node_id = source.item_id();
let node_path = tcx.item_path_str(tcx.map.local_def_id(node_id));
debug!("running on: {:?}", node_path);
- // we only run when mir_opt_level > 1
- match tcx.sess.opts.debugging_opts.mir_opt_level {
- Some(0) |
- Some(1) |
- None => { return; },
- _ => {}
- };
+ // we only run when mir_opt_level > 2
+ if tcx.sess.opts.debugging_opts.mir_opt_level <= 2 {
+ return;
+ }
// Do not trigger on constants. Could be revised in future
if let MirSource::Fn(_) = source {} else { return; }