Skip to content

Commit 22cf833

Browse files
committed
Rename -Z no-verify to -Z verify-llvm-ir
This disables IR verification by default.
1 parent 78a1644 commit 22cf833

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/librustc/session/config.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1152,8 +1152,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
11521152
"gather codegen statistics"),
11531153
asm_comments: bool = (false, parse_bool, [TRACKED],
11541154
"generate comments into the assembly (may change behavior)"),
1155-
no_verify: bool = (false, parse_bool, [TRACKED],
1156-
"skip LLVM verification"),
1155+
verify_llvm_ir: bool = (false, parse_bool, [TRACKED],
1156+
"verify LLVM IR"),
11571157
borrowck_stats: bool = (false, parse_bool, [UNTRACKED],
11581158
"gather borrowck statistics"),
11591159
no_landing_pads: bool = (false, parse_bool, [TRACKED],
@@ -3097,7 +3097,7 @@ mod tests {
30973097
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
30983098

30993099
opts = reference.clone();
3100-
opts.debugging_opts.no_verify = true;
3100+
opts.debugging_opts.verify_llvm_ir = true;
31013101
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
31023102

31033103
opts = reference.clone();

src/librustc/session/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,8 @@ impl Session {
513513
pub fn asm_comments(&self) -> bool {
514514
self.opts.debugging_opts.asm_comments
515515
}
516-
pub fn no_verify(&self) -> bool {
517-
self.opts.debugging_opts.no_verify
516+
pub fn verify_llvm_ir(&self) -> bool {
517+
self.opts.debugging_opts.verify_llvm_ir
518518
}
519519
pub fn borrowck_stats(&self) -> bool {
520520
self.opts.debugging_opts.borrowck_stats

src/librustc_codegen_llvm/back/lto.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ fn run_pass_manager(cgcx: &CodegenContext,
462462
let pm = llvm::LLVMCreatePassManager();
463463
llvm::LLVMRustAddAnalysisPasses(tm, pm, llmod);
464464

465-
if !config.no_verify {
465+
if config.verify_llvm_ir {
466466
let pass = llvm::LLVMRustFindAndCreatePass("verify\0".as_ptr() as *const _);
467467
assert!(!pass.is_null());
468468
llvm::LLVMRustAddPass(pm, pass);
@@ -497,7 +497,7 @@ fn run_pass_manager(cgcx: &CodegenContext,
497497
}
498498
});
499499

500-
if !config.no_verify {
500+
if config.verify_llvm_ir {
501501
let pass = llvm::LLVMRustFindAndCreatePass("verify\0".as_ptr() as *const _);
502502
assert!(!pass.is_null());
503503
llvm::LLVMRustAddPass(pm, pass);

src/librustc_codegen_llvm/back/write.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ pub struct ModuleConfig {
232232
emit_obj: bool,
233233
// Miscellaneous flags. These are mostly copied from command-line
234234
// options.
235-
pub no_verify: bool,
235+
pub verify_llvm_ir: bool,
236236
no_prepopulate_passes: bool,
237237
no_builtins: bool,
238238
time_passes: bool,
@@ -271,7 +271,7 @@ impl ModuleConfig {
271271
embed_bitcode_marker: false,
272272
no_integrated_as: false,
273273

274-
no_verify: false,
274+
verify_llvm_ir: false,
275275
no_prepopulate_passes: false,
276276
no_builtins: false,
277277
time_passes: false,
@@ -283,7 +283,7 @@ impl ModuleConfig {
283283
}
284284

285285
fn set_flags(&mut self, sess: &Session, no_builtins: bool) {
286-
self.no_verify = sess.no_verify();
286+
self.verify_llvm_ir = sess.verify_llvm_ir();
287287
self.no_prepopulate_passes = sess.opts.cg.no_prepopulate_passes;
288288
self.no_builtins = no_builtins || sess.target.target.options.no_builtins;
289289
self.time_passes = sess.time_passes();
@@ -542,7 +542,7 @@ unsafe fn optimize(cgcx: &CodegenContext,
542542
true
543543
};
544544

545-
if !config.no_verify { assert!(addpass("verify")); }
545+
if config.verify_llvm_ir { assert!(addpass("verify")); }
546546
if !config.no_prepopulate_passes {
547547
llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
548548
llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod);

0 commit comments

Comments
 (0)