Add verify-llvm-ir flag to config.toml

This commit is contained in:
Nikita Popov 2018-06-12 21:21:29 +02:00
parent 22cf833dd1
commit 3f18a41333
4 changed files with 14 additions and 0 deletions

View File

@ -356,6 +356,9 @@
# Print backtrace on internal compiler errors during bootstrap
#backtrace-on-ice = false
# Whether to verify generated LLVM IR
#verify-llvm-ir = false
# =============================================================================
# Options for specific targets
#

View File

@ -283,6 +283,10 @@ fn main() {
cmd.arg("--cfg").arg("parallel_queries");
}
if env::var_os("RUSTC_VERIFY_LLVM_IR").is_some() {
cmd.arg("-Z").arg("verify-llvm-ir");
}
let color = match env::var("RUSTC_COLOR") {
Ok(s) => usize::from_str(&s).expect("RUSTC_COLOR should be an integer"),
Err(_) => 0,

View File

@ -898,6 +898,10 @@ impl<'a> Builder<'a> {
cargo.env("RUSTC_BACKTRACE_ON_ICE", "1");
}
if self.config.rust_verify_llvm_ir {
cargo.env("RUSTC_VERIFY_LLVM_IR", "1");
}
cargo.env("RUSTC_VERBOSE", format!("{}", self.verbosity));
// in std, we want to avoid denying warnings for stage 0 as that makes cfg's painful.

View File

@ -105,6 +105,7 @@ pub struct Config {
pub rust_dist_src: bool,
pub rust_codegen_backends: Vec<Interned<String>>,
pub rust_codegen_backends_dir: String,
pub rust_verify_llvm_ir: bool,
pub build: Interned<String>,
pub hosts: Vec<Interned<String>>,
@ -311,6 +312,7 @@ struct Rust {
lld: Option<bool>,
deny_warnings: Option<bool>,
backtrace_on_ice: Option<bool>,
verify_llvm_ir: Option<bool>,
}
/// TOML representation of how each build target is configured.
@ -542,6 +544,7 @@ impl Config {
config.save_toolstates = rust.save_toolstates.clone().map(PathBuf::from);
set(&mut config.deny_warnings, rust.deny_warnings.or(flags.warnings));
set(&mut config.backtrace_on_ice, rust.backtrace_on_ice);
set(&mut config.rust_verify_llvm_ir, rust.verify_llvm_ir);
if let Some(ref backends) = rust.codegen_backends {
config.rust_codegen_backends = backends.iter()