1
Fork 0

Rename LLVM optimize functions

This commit is contained in:
Josh Stone 2022-09-19 11:10:12 -07:00
parent 29124c7fd0
commit 00bb9fc2be
3 changed files with 5 additions and 5 deletions

View file

@ -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(())

View file

@ -416,7 +416,7 @@ fn get_instr_profile_output_path(config: &ModuleConfig) -> Option<CString> {
}
}
pub(crate) unsafe fn optimize(
pub(crate) unsafe fn llvm_optimize(
cgcx: &CodegenContext<LlvmCodegenBackend>,
diag_handler: &Handler,
module: &ModuleCodegen<ModuleLlvm>,
@ -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<LlvmCodegenBackend>,
diag_handler: &Handler,
module: &ModuleCodegen<ModuleLlvm>,
@ -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(())
}

View file

@ -207,7 +207,7 @@ impl WriteBackendMethods for LlvmCodegenBackend {
module: &ModuleCodegen<Self::Module>,
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<Self>,