mirror of
https://github.com/ziglang/zig.git
synced 2026-02-05 14:07:04 +00:00
ZigLLVMTargetMachineEmitToFile: put sanitizers in registerOptimizerLastEPCallback
matching the default of clang's behavior. I originally put them in registerOptimizerEarlyEPCallback because I thought clang was doing that, but I see now it is behind the flag `--sanitizer-early-opt-ep` which is disabled by default.
This commit is contained in:
parent
b5398180d6
commit
e8e49efe21
@ -311,7 +311,10 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi
|
||||
}
|
||||
});
|
||||
|
||||
pass_builder.registerOptimizerEarlyEPCallback([&](ModulePassManager &module_pm, OptimizationLevel OL) {
|
||||
//pass_builder.registerOptimizerEarlyEPCallback([&](ModulePassManager &module_pm, OptimizationLevel OL) {
|
||||
//});
|
||||
|
||||
pass_builder.registerOptimizerLastEPCallback([&](ModulePassManager &module_pm, OptimizationLevel level) {
|
||||
// Code coverage instrumentation.
|
||||
if (options.sancov) {
|
||||
module_pm.addPass(SanitizerCoveragePass(getSanCovOptions(options.coverage)));
|
||||
@ -322,9 +325,7 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi
|
||||
module_pm.addPass(ModuleThreadSanitizerPass());
|
||||
module_pm.addPass(createModuleToFunctionPassAdaptor(ThreadSanitizerPass()));
|
||||
}
|
||||
});
|
||||
|
||||
pass_builder.registerOptimizerLastEPCallback([&](ModulePassManager &module_pm, OptimizationLevel level) {
|
||||
// Verify the output
|
||||
if (assertions_on) {
|
||||
module_pm.addPass(VerifierPass());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user