// try to not rely on this too much.
actually_rustdoc: bool [TRACKED],
- // Number of object files/codegen units to produce on the backend
+ // Specifications of codegen units / ThinLTO which are forced as a
+ // result of parsing command line options. These are not necessarily
+ // what rustc was invoked with, but massaged a bit to agree with
+ // commands like `--emit llvm-ir` which they're often incompatible with
+ // if we otherwise use the defaults of rustc.
cli_forced_codegen_units: Option<usize> [UNTRACKED],
+ cli_forced_thinlto: Option<bool> [UNTRACKED],
}
);
debug_assertions: true,
actually_rustdoc: false,
cli_forced_codegen_units: None,
+ cli_forced_thinlto: None,
}
}
"run the non-lexical lifetimes MIR pass"),
trans_time_graph: bool = (false, parse_bool, [UNTRACKED],
"generate a graphical HTML report of time spent in trans and LLVM"),
- thinlto: bool = (false, parse_bool, [TRACKED],
+ thinlto: Option<bool> = (None, parse_opt_bool, [TRACKED],
"enable ThinLTO when possible"),
inline_in_all_cgus: Option<bool> = (None, parse_opt_bool, [TRACKED],
"control whether #[inline] functions are in all cgus"),
let mut cg = build_codegen_options(matches, error_format);
let mut codegen_units = cg.codegen_units;
+ let mut thinlto = None;
// Issue #30063: if user requests llvm-related output to one
// particular path, disable codegen-units.
}
early_warn(error_format, "resetting to default -C codegen-units=1");
codegen_units = Some(1);
+ thinlto = Some(false);
}
}
- _ => codegen_units = Some(1),
+ _ => {
+ codegen_units = Some(1);
+ thinlto = Some(false);
+ }
}
}
debug_assertions,
actually_rustdoc: false,
cli_forced_codegen_units: codegen_units,
+ cli_forced_thinlto: thinlto,
},
cfg)
}