File tree 4 files changed +14
-0
lines changed
4 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 356
356
# Print backtrace on internal compiler errors during bootstrap
357
357
#backtrace-on-ice = false
358
358
359
+ # Whether to verify generated LLVM IR
360
+ #verify-llvm-ir = false
361
+
359
362
# =============================================================================
360
363
# Options for specific targets
361
364
#
Original file line number Diff line number Diff line change @@ -283,6 +283,10 @@ fn main() {
283
283
cmd. arg ( "--cfg" ) . arg ( "parallel_queries" ) ;
284
284
}
285
285
286
+ if env:: var_os ( "RUSTC_VERIFY_LLVM_IR" ) . is_some ( ) {
287
+ cmd. arg ( "-Z" ) . arg ( "verify-llvm-ir" ) ;
288
+ }
289
+
286
290
let color = match env:: var ( "RUSTC_COLOR" ) {
287
291
Ok ( s) => usize:: from_str ( & s) . expect ( "RUSTC_COLOR should be an integer" ) ,
288
292
Err ( _) => 0 ,
Original file line number Diff line number Diff line change @@ -898,6 +898,10 @@ impl<'a> Builder<'a> {
898
898
cargo. env ( "RUSTC_BACKTRACE_ON_ICE" , "1" ) ;
899
899
}
900
900
901
+ if self . config . rust_verify_llvm_ir {
902
+ cargo. env ( "RUSTC_VERIFY_LLVM_IR" , "1" ) ;
903
+ }
904
+
901
905
cargo. env ( "RUSTC_VERBOSE" , format ! ( "{}" , self . verbosity) ) ;
902
906
903
907
// in std, we want to avoid denying warnings for stage 0 as that makes cfg's painful.
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ pub struct Config {
105
105
pub rust_dist_src : bool ,
106
106
pub rust_codegen_backends : Vec < Interned < String > > ,
107
107
pub rust_codegen_backends_dir : String ,
108
+ pub rust_verify_llvm_ir : bool ,
108
109
109
110
pub build : Interned < String > ,
110
111
pub hosts : Vec < Interned < String > > ,
@@ -311,6 +312,7 @@ struct Rust {
311
312
lld : Option < bool > ,
312
313
deny_warnings : Option < bool > ,
313
314
backtrace_on_ice : Option < bool > ,
315
+ verify_llvm_ir : Option < bool > ,
314
316
}
315
317
316
318
/// TOML representation of how each build target is configured.
@@ -542,6 +544,7 @@ impl Config {
542
544
config. save_toolstates = rust. save_toolstates . clone ( ) . map ( PathBuf :: from) ;
543
545
set ( & mut config. deny_warnings , rust. deny_warnings . or ( flags. warnings ) ) ;
544
546
set ( & mut config. backtrace_on_ice , rust. backtrace_on_ice ) ;
547
+ set ( & mut config. rust_verify_llvm_ir , rust. verify_llvm_ir ) ;
545
548
546
549
if let Some ( ref backends) = rust. codegen_backends {
547
550
config. rust_codegen_backends = backends. iter ( )
You can’t perform that action at this time.
0 commit comments