Add verify-llvm-ir flag to config.toml
This commit is contained in:
parent
22cf833dd1
commit
3f18a41333
4 changed files with 14 additions and 0 deletions
|
@ -356,6 +356,9 @@
|
||||||
# Print backtrace on internal compiler errors during bootstrap
|
# Print backtrace on internal compiler errors during bootstrap
|
||||||
#backtrace-on-ice = false
|
#backtrace-on-ice = false
|
||||||
|
|
||||||
|
# Whether to verify generated LLVM IR
|
||||||
|
#verify-llvm-ir = false
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# Options for specific targets
|
# Options for specific targets
|
||||||
#
|
#
|
||||||
|
|
|
@ -283,6 +283,10 @@ fn main() {
|
||||||
cmd.arg("--cfg").arg("parallel_queries");
|
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") {
|
let color = match env::var("RUSTC_COLOR") {
|
||||||
Ok(s) => usize::from_str(&s).expect("RUSTC_COLOR should be an integer"),
|
Ok(s) => usize::from_str(&s).expect("RUSTC_COLOR should be an integer"),
|
||||||
Err(_) => 0,
|
Err(_) => 0,
|
||||||
|
|
|
@ -898,6 +898,10 @@ impl<'a> Builder<'a> {
|
||||||
cargo.env("RUSTC_BACKTRACE_ON_ICE", "1");
|
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));
|
cargo.env("RUSTC_VERBOSE", format!("{}", self.verbosity));
|
||||||
|
|
||||||
// in std, we want to avoid denying warnings for stage 0 as that makes cfg's painful.
|
// in std, we want to avoid denying warnings for stage 0 as that makes cfg's painful.
|
||||||
|
|
|
@ -105,6 +105,7 @@ pub struct Config {
|
||||||
pub rust_dist_src: bool,
|
pub rust_dist_src: bool,
|
||||||
pub rust_codegen_backends: Vec<Interned<String>>,
|
pub rust_codegen_backends: Vec<Interned<String>>,
|
||||||
pub rust_codegen_backends_dir: String,
|
pub rust_codegen_backends_dir: String,
|
||||||
|
pub rust_verify_llvm_ir: bool,
|
||||||
|
|
||||||
pub build: Interned<String>,
|
pub build: Interned<String>,
|
||||||
pub hosts: Vec<Interned<String>>,
|
pub hosts: Vec<Interned<String>>,
|
||||||
|
@ -311,6 +312,7 @@ struct Rust {
|
||||||
lld: Option<bool>,
|
lld: Option<bool>,
|
||||||
deny_warnings: Option<bool>,
|
deny_warnings: Option<bool>,
|
||||||
backtrace_on_ice: Option<bool>,
|
backtrace_on_ice: Option<bool>,
|
||||||
|
verify_llvm_ir: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// TOML representation of how each build target is configured.
|
/// 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);
|
config.save_toolstates = rust.save_toolstates.clone().map(PathBuf::from);
|
||||||
set(&mut config.deny_warnings, rust.deny_warnings.or(flags.warnings));
|
set(&mut config.deny_warnings, rust.deny_warnings.or(flags.warnings));
|
||||||
set(&mut config.backtrace_on_ice, rust.backtrace_on_ice);
|
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 {
|
if let Some(ref backends) = rust.codegen_backends {
|
||||||
config.rust_codegen_backends = backends.iter()
|
config.rust_codegen_backends = backends.iter()
|
||||||
|
|
Loading…
Add table
Reference in a new issue