diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2022-04-30 20:50:17 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2022-04-30 20:50:17 +0200 |
| commit | 336bb0afea102a0e4ec7f56c364c7cd0d2acb902 (patch) | |
| tree | 8b28b32641c0b180ac645a7a36600c0e233104f5 | |
| parent | 76d4862fdd131b6f79dc0a31857f888d26bcdb27 (diff) | |
| download | rust-336bb0afea102a0e4ec7f56c364c7cd0d2acb902.tar.gz rust-336bb0afea102a0e4ec7f56c364c7cd0d2acb902.zip | |
Rename run_lto_pass_manager to optimize_fat and remove thin parameter
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/lib.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/lib.rs | 17 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/traits/write.rs | 11 |
3 files changed, 18 insertions, 20 deletions
diff --git a/compiler/rustc_codegen_gcc/src/lib.rs b/compiler/rustc_codegen_gcc/src/lib.rs index 497a28354d8..2b960582879 100644 --- a/compiler/rustc_codegen_gcc/src/lib.rs +++ b/compiler/rustc_codegen_gcc/src/lib.rs @@ -229,6 +229,11 @@ impl WriteBackendMethods for GccCodegenBackend { Ok(()) } + fn optimize_fat(_cgcx: &CodegenContext<Self>, _module: &ModuleCodegen<Self::Module>, _config: &ModuleConfig) -> Result<(), FatalError> { + // TODO(antoyo) + Ok(()) + } + unsafe fn optimize_thin(_cgcx: &CodegenContext<Self>, _thin: &mut ThinModule<Self>) -> Result<ModuleCodegen<Self::Module>, FatalError> { unimplemented!(); } @@ -245,11 +250,6 @@ impl WriteBackendMethods for GccCodegenBackend { unimplemented!(); } - fn run_lto_pass_manager(_cgcx: &CodegenContext<Self>, _module: &ModuleCodegen<Self::Module>, _config: &ModuleConfig, _thin: bool) -> Result<(), FatalError> { - // TODO(antoyo) - Ok(()) - } - fn run_link(cgcx: &CodegenContext<Self>, diag_handler: &Handler, modules: Vec<ModuleCodegen<Self::Module>>) -> Result<ModuleCodegen<Self::Module>, FatalError> { back::write::link(cgcx, diag_handler, modules) } diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 3152c505af0..3fa906f497d 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -210,6 +210,14 @@ impl WriteBackendMethods for LlvmCodegenBackend { ) -> Result<(), FatalError> { back::write::optimize(cgcx, diag_handler, module, config) } + fn optimize_fat( + cgcx: &CodegenContext<Self>, + module: &ModuleCodegen<Self::Module>, + config: &ModuleConfig, + ) -> Result<(), FatalError> { + let diag_handler = cgcx.create_diag_handler(); + back::lto::run_pass_manager(cgcx, &diag_handler, module, config, false) + } unsafe fn optimize_thin( cgcx: &CodegenContext<Self>, thin: &mut ThinModule<Self>, @@ -230,15 +238,6 @@ impl WriteBackendMethods for LlvmCodegenBackend { fn serialize_module(module: ModuleCodegen<Self::Module>) -> (String, Self::ModuleBuffer) { (module.name, back::lto::ModuleBuffer::new(module.module_llvm.llmod())) } - fn run_lto_pass_manager( - cgcx: &CodegenContext<Self>, - module: &ModuleCodegen<Self::Module>, - config: &ModuleConfig, - thin: bool, - ) -> Result<(), FatalError> { - let diag_handler = cgcx.create_diag_handler(); - back::lto::run_pass_manager(cgcx, &diag_handler, module, config, thin) - } } unsafe impl Send for LlvmCodegenBackend {} // Llvm is on a per-thread basis diff --git a/compiler/rustc_codegen_ssa/src/traits/write.rs b/compiler/rustc_codegen_ssa/src/traits/write.rs index 93fbee2b49b..4914de20b05 100644 --- a/compiler/rustc_codegen_ssa/src/traits/write.rs +++ b/compiler/rustc_codegen_ssa/src/traits/write.rs @@ -41,6 +41,11 @@ pub trait WriteBackendMethods: 'static + Sized + Clone { module: &ModuleCodegen<Self::Module>, config: &ModuleConfig, ) -> Result<(), FatalError>; + fn optimize_fat( + cgcx: &CodegenContext<Self>, + llmod: &ModuleCodegen<Self::Module>, + config: &ModuleConfig, + ) -> Result<(), FatalError>; unsafe fn optimize_thin( cgcx: &CodegenContext<Self>, thin: &mut ThinModule<Self>, @@ -53,12 +58,6 @@ pub trait WriteBackendMethods: 'static + Sized + Clone { ) -> Result<CompiledModule, FatalError>; fn prepare_thin(module: ModuleCodegen<Self::Module>) -> (String, Self::ThinBuffer); fn serialize_module(module: ModuleCodegen<Self::Module>) -> (String, Self::ModuleBuffer); - fn run_lto_pass_manager( - cgcx: &CodegenContext<Self>, - llmod: &ModuleCodegen<Self::Module>, - config: &ModuleConfig, - thin: bool, - ) -> Result<(), FatalError>; } pub trait ThinBufferMethods: Send + Sync { |
