| ... | ... | @@ -277,15 +277,8 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM |
| 277 | 277 | }); |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | | // Passes for either debug or release build |
| 281 | | if (is_debug) { |
| 282 | | // NOTE: Always inliner will go away (in debug build) |
| 283 | | // when the self-hosted compiler becomes mature. |
| 284 | | pass_builder.registerPipelineStartEPCallback( |
| 285 | | [](ModulePassManager &module_pm, OptimizationLevel OL) { |
| 286 | | module_pm.addPass(AlwaysInlinerPass()); |
| 287 | | }); |
| 288 | | } else { |
| 280 | // Passes specific for release build |
| 281 | if (!is_debug) { |
| 289 | 282 | pass_builder.registerPipelineStartEPCallback( |
| 290 | 283 | [](ModulePassManager &module_pm, OptimizationLevel OL) { |
| 291 | 284 | module_pm.addPass( |
| ... | ... | @@ -312,10 +305,10 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM |
| 312 | 305 | opt_level = OptimizationLevel::O3; |
| 313 | 306 | |
| 314 | 307 | // Initialize the PassManager |
| 315 | | if (lto) { |
| 308 | if (opt_level == OptimizationLevel::O0) { |
| 309 | module_pm = pass_builder.buildO0DefaultPipeline(opt_level, lto); |
| 310 | } else if (lto) { |
| 316 | 311 | module_pm = pass_builder.buildLTOPreLinkDefaultPipeline(opt_level); |
| 317 | | module_pm.addPass(CanonicalizeAliasesPass()); |
| 318 | | module_pm.addPass(NameAnonGlobalPass()); |
| 319 | 312 | } else { |
| 320 | 313 | module_pm = pass_builder.buildPerModuleDefaultPipeline(opt_level); |
| 321 | 314 | } |