diff --git a/compiler/rustc_codegen_llvm/src/back/lto.rs b/compiler/rustc_codegen_llvm/src/back/lto.rs index daf58d7152d..2049422b79a 100644 --- a/compiler/rustc_codegen_llvm/src/back/lto.rs +++ b/compiler/rustc_codegen_llvm/src/back/lto.rs @@ -597,7 +597,7 @@ pub(crate) fn run_pass_manager( } let opt_stage = if thin { llvm::OptStage::ThinLTO } else { llvm::OptStage::FatLTO }; let opt_level = config.opt_level.unwrap_or(config::OptLevel::No); - write::optimize(cgcx, diag_handler, module, config, opt_level, opt_stage)?; + write::llvm_optimize(cgcx, diag_handler, module, config, opt_level, opt_stage)?; } debug!("lto done"); Ok(()) diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index 92a44a9f426..db526746fa7 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -416,7 +416,7 @@ fn get_instr_profile_output_path(config: &ModuleConfig) -> Option { } } -pub(crate) unsafe fn optimize( +pub(crate) unsafe fn llvm_optimize( cgcx: &CodegenContext, diag_handler: &Handler, module: &ModuleCodegen, @@ -498,7 +498,7 @@ pub(crate) unsafe fn optimize( } // Unsafe due to LLVM calls. -pub(crate) unsafe fn maybe_optimize( +pub(crate) unsafe fn optimize( cgcx: &CodegenContext, diag_handler: &Handler, module: &ModuleCodegen, @@ -526,7 +526,7 @@ pub(crate) unsafe fn maybe_optimize( _ if cgcx.opts.cg.linker_plugin_lto.enabled() => llvm::OptStage::PreLinkThinLTO, _ => llvm::OptStage::PreLinkNoLTO, }; - return optimize(cgcx, diag_handler, module, config, opt_level, opt_stage); + return llvm_optimize(cgcx, diag_handler, module, config, opt_level, opt_stage); } Ok(()) } diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 518f9a45733..42c65e04e3b 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -207,7 +207,7 @@ impl WriteBackendMethods for LlvmCodegenBackend { module: &ModuleCodegen, config: &ModuleConfig, ) -> Result<(), FatalError> { - back::write::maybe_optimize(cgcx, diag_handler, module, config) + back::write::optimize(cgcx, diag_handler, module, config) } fn optimize_fat( cgcx: &CodegenContext,