| ... | @@ -311,7 +311,10 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi | ... | @@ -311,7 +311,10 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi |
| 311 | } | 311 | } |
| 312 | }); | 312 | }); |
| 313 | | 313 | |
| 314 | pass_builder.registerOptimizerEarlyEPCallback([&](ModulePassManager &module_pm, OptimizationLevel OL) { | 314 | //pass_builder.registerOptimizerEarlyEPCallback([&](ModulePassManager &module_pm, OptimizationLevel OL) { |
| | 315 | //}); |
| | 316 | |
| | 317 | pass_builder.registerOptimizerLastEPCallback([&](ModulePassManager &module_pm, OptimizationLevel level) { |
| 315 | // Code coverage instrumentation. | 318 | // Code coverage instrumentation. |
| 316 | if (options.sancov) { | 319 | if (options.sancov) { |
| 317 | module_pm.addPass(SanitizerCoveragePass(getSanCovOptions(options.coverage))); | 320 | module_pm.addPass(SanitizerCoveragePass(getSanCovOptions(options.coverage))); |
| ... | @@ -322,9 +325,7 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi | ... | @@ -322,9 +325,7 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi |
| 322 | module_pm.addPass(ModuleThreadSanitizerPass()); | 325 | module_pm.addPass(ModuleThreadSanitizerPass()); |
| 323 | module_pm.addPass(createModuleToFunctionPassAdaptor(ThreadSanitizerPass())); | 326 | module_pm.addPass(createModuleToFunctionPassAdaptor(ThreadSanitizerPass())); |
| 324 | } | 327 | } |
| 325 | }); | | |
| 326 | | 328 | |
| 327 | pass_builder.registerOptimizerLastEPCallback([&](ModulePassManager &module_pm, OptimizationLevel level) { | | |
| 328 | // Verify the output | 329 | // Verify the output |
| 329 | if (assertions_on) { | 330 | if (assertions_on) { |
| 330 | module_pm.addPass(VerifierPass()); | 331 | module_pm.addPass(VerifierPass()); |