self.debugging_opts.dump_dep_graph ||
self.debugging_opts.query_dep_graph
}
+
+ pub fn single_codegen_unit(&self) -> bool {
+ self.incremental.is_none() ||
+ self.cg.codegen_units == 1
+ }
}
// The type of entry function, so
pub const parse_bool: Option<&'static str> = None;
pub const parse_opt_bool: Option<&'static str> =
Some("one of: `y`, `yes`, `on`, `n`, `no`, or `off`");
+ pub const parse_all_bool: Option<&'static str> =
+ Some("one of: `y`, `yes`, `on`, `n`, `no`, or `off`");
pub const parse_string: Option<&'static str> = Some("a string");
pub const parse_opt_string: Option<&'static str> = Some("a string");
pub const parse_list: Option<&'static str> = Some("a space-separated list of strings");
}
}
+ fn parse_all_bool(slot: &mut bool, v: Option<&str>) -> bool {
+ match v {
+ Some(s) => {
+ match s {
+ "n" | "no" | "off" => {
+ *slot = false;
+ }
+ "y" | "yes" | "on" => {
+ *slot = true;
+ }
+ _ => { return false; }
+ }
+
+ true
+ },
+ None => { *slot = true; true }
+ }
+ }
+
fn parse_opt_string(slot: &mut Option<String>, v: Option<&str>) -> bool {
match v {
Some(s) => { *slot = Some(s.to_string()); true },
"panic strategy to compile crate with"),
}
-
options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
build_debugging_options, "Z", "debugging",
DB_OPTIONS, db_type_desc, dbsetters,
"dump MIR state at various points in translation"),
dump_mir_dir: Option<String> = (None, parse_opt_string,
"the directory the MIR is dumped into"),
- orbit: bool = (false, parse_bool,
+ orbit: bool = (true, parse_all_bool,
"get MIR where it belongs - everywhere; most importantly, in orbit"),
}
})
});
- let debugging_opts = build_debugging_options(matches, error_format);
+ let mut debugging_opts = build_debugging_options(matches, error_format);
+
+ // Incremental compilation only works reliably when translation is done via
+ // MIR, so let's enable -Z orbit if necessary (see #34973).
+ if debugging_opts.incremental.is_some() && !debugging_opts.orbit {
+ early_warn(error_format, "Automatically enabling `-Z orbit` because \
+ `-Z incremental` was specified");
+ debugging_opts.orbit = true;
+ }
let parse_only = debugging_opts.parse_only;
let no_trans = debugging_opts.no_trans;