Skip to content

Commit 336bb0a

Browse files
committed
Rename run_lto_pass_manager to optimize_fat and remove thin parameter
1 parent 76d4862 commit 336bb0a

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

compiler/rustc_codegen_gcc/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ impl WriteBackendMethods for GccCodegenBackend {
229229
Ok(())
230230
}
231231

232+
fn optimize_fat(_cgcx: &CodegenContext<Self>, _module: &ModuleCodegen<Self::Module>, _config: &ModuleConfig) -> Result<(), FatalError> {
233+
// TODO(antoyo)
234+
Ok(())
235+
}
236+
232237
unsafe fn optimize_thin(_cgcx: &CodegenContext<Self>, _thin: &mut ThinModule<Self>) -> Result<ModuleCodegen<Self::Module>, FatalError> {
233238
unimplemented!();
234239
}
@@ -245,11 +250,6 @@ impl WriteBackendMethods for GccCodegenBackend {
245250
unimplemented!();
246251
}
247252

248-
fn run_lto_pass_manager(_cgcx: &CodegenContext<Self>, _module: &ModuleCodegen<Self::Module>, _config: &ModuleConfig, _thin: bool) -> Result<(), FatalError> {
249-
// TODO(antoyo)
250-
Ok(())
251-
}
252-
253253
fn run_link(cgcx: &CodegenContext<Self>, diag_handler: &Handler, modules: Vec<ModuleCodegen<Self::Module>>) -> Result<ModuleCodegen<Self::Module>, FatalError> {
254254
back::write::link(cgcx, diag_handler, modules)
255255
}

compiler/rustc_codegen_llvm/src/lib.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,14 @@ impl WriteBackendMethods for LlvmCodegenBackend {
210210
) -> Result<(), FatalError> {
211211
back::write::optimize(cgcx, diag_handler, module, config)
212212
}
213+
fn optimize_fat(
214+
cgcx: &CodegenContext<Self>,
215+
module: &ModuleCodegen<Self::Module>,
216+
config: &ModuleConfig,
217+
) -> Result<(), FatalError> {
218+
let diag_handler = cgcx.create_diag_handler();
219+
back::lto::run_pass_manager(cgcx, &diag_handler, module, config, false)
220+
}
213221
unsafe fn optimize_thin(
214222
cgcx: &CodegenContext<Self>,
215223
thin: &mut ThinModule<Self>,
@@ -230,15 +238,6 @@ impl WriteBackendMethods for LlvmCodegenBackend {
230238
fn serialize_module(module: ModuleCodegen<Self::Module>) -> (String, Self::ModuleBuffer) {
231239
(module.name, back::lto::ModuleBuffer::new(module.module_llvm.llmod()))
232240
}
233-
fn run_lto_pass_manager(
234-
cgcx: &CodegenContext<Self>,
235-
module: &ModuleCodegen<Self::Module>,
236-
config: &ModuleConfig,
237-
thin: bool,
238-
) -> Result<(), FatalError> {
239-
let diag_handler = cgcx.create_diag_handler();
240-
back::lto::run_pass_manager(cgcx, &diag_handler, module, config, thin)
241-
}
242241
}
243242

244243
unsafe impl Send for LlvmCodegenBackend {} // Llvm is on a per-thread basis

compiler/rustc_codegen_ssa/src/traits/write.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ pub trait WriteBackendMethods: 'static + Sized + Clone {
4141
module: &ModuleCodegen<Self::Module>,
4242
config: &ModuleConfig,
4343
) -> Result<(), FatalError>;
44+
fn optimize_fat(
45+
cgcx: &CodegenContext<Self>,
46+
llmod: &ModuleCodegen<Self::Module>,
47+
config: &ModuleConfig,
48+
) -> Result<(), FatalError>;
4449
unsafe fn optimize_thin(
4550
cgcx: &CodegenContext<Self>,
4651
thin: &mut ThinModule<Self>,
@@ -53,12 +58,6 @@ pub trait WriteBackendMethods: 'static + Sized + Clone {
5358
) -> Result<CompiledModule, FatalError>;
5459
fn prepare_thin(module: ModuleCodegen<Self::Module>) -> (String, Self::ThinBuffer);
5560
fn serialize_module(module: ModuleCodegen<Self::Module>) -> (String, Self::ModuleBuffer);
56-
fn run_lto_pass_manager(
57-
cgcx: &CodegenContext<Self>,
58-
llmod: &ModuleCodegen<Self::Module>,
59-
config: &ModuleConfig,
60-
thin: bool,
61-
) -> Result<(), FatalError>;
6261
}
6362

6463
pub trait ThinBufferMethods: Send + Sync {

0 commit comments

Comments
 (0)