Rename -Z no-verify to -Z verify-llvm-ir
This disables IR verification by default.
This commit is contained in:
parent
78a16443a3
commit
22cf833dd1
@ -1152,8 +1152,8 @@ fn parse_cross_lang_lto(slot: &mut CrossLangLto, v: Option<&str>) -> bool {
|
|||||||
"gather codegen statistics"),
|
"gather codegen statistics"),
|
||||||
asm_comments: bool = (false, parse_bool, [TRACKED],
|
asm_comments: bool = (false, parse_bool, [TRACKED],
|
||||||
"generate comments into the assembly (may change behavior)"),
|
"generate comments into the assembly (may change behavior)"),
|
||||||
no_verify: bool = (false, parse_bool, [TRACKED],
|
verify_llvm_ir: bool = (false, parse_bool, [TRACKED],
|
||||||
"skip LLVM verification"),
|
"verify LLVM IR"),
|
||||||
borrowck_stats: bool = (false, parse_bool, [UNTRACKED],
|
borrowck_stats: bool = (false, parse_bool, [UNTRACKED],
|
||||||
"gather borrowck statistics"),
|
"gather borrowck statistics"),
|
||||||
no_landing_pads: bool = (false, parse_bool, [TRACKED],
|
no_landing_pads: bool = (false, parse_bool, [TRACKED],
|
||||||
@ -3097,7 +3097,7 @@ fn test_debugging_options_tracking_hash() {
|
|||||||
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
|
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
|
||||||
|
|
||||||
opts = reference.clone();
|
opts = reference.clone();
|
||||||
opts.debugging_opts.no_verify = true;
|
opts.debugging_opts.verify_llvm_ir = true;
|
||||||
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
|
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
|
||||||
|
|
||||||
opts = reference.clone();
|
opts = reference.clone();
|
||||||
|
@ -513,8 +513,8 @@ pub fn meta_stats(&self) -> bool {
|
|||||||
pub fn asm_comments(&self) -> bool {
|
pub fn asm_comments(&self) -> bool {
|
||||||
self.opts.debugging_opts.asm_comments
|
self.opts.debugging_opts.asm_comments
|
||||||
}
|
}
|
||||||
pub fn no_verify(&self) -> bool {
|
pub fn verify_llvm_ir(&self) -> bool {
|
||||||
self.opts.debugging_opts.no_verify
|
self.opts.debugging_opts.verify_llvm_ir
|
||||||
}
|
}
|
||||||
pub fn borrowck_stats(&self) -> bool {
|
pub fn borrowck_stats(&self) -> bool {
|
||||||
self.opts.debugging_opts.borrowck_stats
|
self.opts.debugging_opts.borrowck_stats
|
||||||
|
@ -462,7 +462,7 @@ fn run_pass_manager(cgcx: &CodegenContext,
|
|||||||
let pm = llvm::LLVMCreatePassManager();
|
let pm = llvm::LLVMCreatePassManager();
|
||||||
llvm::LLVMRustAddAnalysisPasses(tm, pm, llmod);
|
llvm::LLVMRustAddAnalysisPasses(tm, pm, llmod);
|
||||||
|
|
||||||
if !config.no_verify {
|
if config.verify_llvm_ir {
|
||||||
let pass = llvm::LLVMRustFindAndCreatePass("verify\0".as_ptr() as *const _);
|
let pass = llvm::LLVMRustFindAndCreatePass("verify\0".as_ptr() as *const _);
|
||||||
assert!(!pass.is_null());
|
assert!(!pass.is_null());
|
||||||
llvm::LLVMRustAddPass(pm, pass);
|
llvm::LLVMRustAddPass(pm, pass);
|
||||||
@ -497,7 +497,7 @@ fn run_pass_manager(cgcx: &CodegenContext,
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if !config.no_verify {
|
if config.verify_llvm_ir {
|
||||||
let pass = llvm::LLVMRustFindAndCreatePass("verify\0".as_ptr() as *const _);
|
let pass = llvm::LLVMRustFindAndCreatePass("verify\0".as_ptr() as *const _);
|
||||||
assert!(!pass.is_null());
|
assert!(!pass.is_null());
|
||||||
llvm::LLVMRustAddPass(pm, pass);
|
llvm::LLVMRustAddPass(pm, pass);
|
||||||
|
@ -232,7 +232,7 @@ pub struct ModuleConfig {
|
|||||||
emit_obj: bool,
|
emit_obj: bool,
|
||||||
// Miscellaneous flags. These are mostly copied from command-line
|
// Miscellaneous flags. These are mostly copied from command-line
|
||||||
// options.
|
// options.
|
||||||
pub no_verify: bool,
|
pub verify_llvm_ir: bool,
|
||||||
no_prepopulate_passes: bool,
|
no_prepopulate_passes: bool,
|
||||||
no_builtins: bool,
|
no_builtins: bool,
|
||||||
time_passes: bool,
|
time_passes: bool,
|
||||||
@ -271,7 +271,7 @@ fn new(passes: Vec<String>) -> ModuleConfig {
|
|||||||
embed_bitcode_marker: false,
|
embed_bitcode_marker: false,
|
||||||
no_integrated_as: false,
|
no_integrated_as: false,
|
||||||
|
|
||||||
no_verify: false,
|
verify_llvm_ir: false,
|
||||||
no_prepopulate_passes: false,
|
no_prepopulate_passes: false,
|
||||||
no_builtins: false,
|
no_builtins: false,
|
||||||
time_passes: false,
|
time_passes: false,
|
||||||
@ -283,7 +283,7 @@ fn new(passes: Vec<String>) -> ModuleConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn set_flags(&mut self, sess: &Session, no_builtins: bool) {
|
fn set_flags(&mut self, sess: &Session, no_builtins: bool) {
|
||||||
self.no_verify = sess.no_verify();
|
self.verify_llvm_ir = sess.verify_llvm_ir();
|
||||||
self.no_prepopulate_passes = sess.opts.cg.no_prepopulate_passes;
|
self.no_prepopulate_passes = sess.opts.cg.no_prepopulate_passes;
|
||||||
self.no_builtins = no_builtins || sess.target.target.options.no_builtins;
|
self.no_builtins = no_builtins || sess.target.target.options.no_builtins;
|
||||||
self.time_passes = sess.time_passes();
|
self.time_passes = sess.time_passes();
|
||||||
@ -542,7 +542,7 @@ unsafe fn optimize(cgcx: &CodegenContext,
|
|||||||
true
|
true
|
||||||
};
|
};
|
||||||
|
|
||||||
if !config.no_verify { assert!(addpass("verify")); }
|
if config.verify_llvm_ir { assert!(addpass("verify")); }
|
||||||
if !config.no_prepopulate_passes {
|
if !config.no_prepopulate_passes {
|
||||||
llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
|
llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
|
||||||
llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod);
|
llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod);
|
||||||
|
Loading…
Reference in New Issue
Block a user