Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_gcc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,16 +430,16 @@ impl WriteBackendMethods for GccCodegenBackend {
}

fn optimize_and_codegen_fat_lto(
sess: &Session,
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
shared_emitter: &SharedEmitter,
_tm_factory: TargetMachineFactoryFn<Self>,
// FIXME(bjorn3): Limit LTO exports to these symbols
_exported_symbols_for_lto: &[String],
each_linked_rlib_for_lto: &[PathBuf],
modules: Vec<FatLtoInput<Self>>,
) -> CompiledModule {
back::lto::run_fat(cgcx, prof, shared_emitter, each_linked_rlib_for_lto, modules)
back::lto::run_fat(cgcx, &sess.prof, shared_emitter, each_linked_rlib_for_lto, modules)
}

fn run_thin_lto(
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ impl WriteBackendMethods for LlvmCodegenBackend {
back::write::target_machine_factory(sess, optlvl, target_features)
}
fn optimize_and_codegen_fat_lto(
sess: &Session,
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
shared_emitter: &SharedEmitter,
tm_factory: TargetMachineFactoryFn<LlvmCodegenBackend>,
exported_symbols_for_lto: &[String],
Expand All @@ -143,7 +143,7 @@ impl WriteBackendMethods for LlvmCodegenBackend {
) -> CompiledModule {
let mut module = back::lto::run_fat(
cgcx,
prof,
&sess.prof,
shared_emitter,
tm_factory,
exported_symbols_for_lto,
Expand All @@ -153,9 +153,9 @@ impl WriteBackendMethods for LlvmCodegenBackend {

let dcx = DiagCtxt::new(Box::new(shared_emitter.clone()));
let dcx = dcx.handle();
back::lto::run_pass_manager(cgcx, prof, dcx, &mut module, false);
back::lto::run_pass_manager(cgcx, &sess.prof, dcx, &mut module, false);

back::write::codegen(cgcx, prof, shared_emitter, module, &cgcx.module_config)
back::write::codegen(cgcx, &sess.prof, shared_emitter, module, &cgcx.module_config)
}
fn run_thin_lto(
cgcx: &CodegenContext,
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -961,24 +961,24 @@ fn execute_copy_from_cache_work_item(
}

fn do_fat_lto<B: WriteBackendMethods>(
sess: &Session,
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
shared_emitter: SharedEmitter,
tm_factory: TargetMachineFactoryFn<B>,
exported_symbols_for_lto: &[String],
each_linked_rlib_for_lto: &[PathBuf],
needs_fat_lto: Vec<FatLtoInput<B>>,
) -> CompiledModule {
let _timer = prof.verbose_generic_activity("LLVM_fatlto");
let _timer = sess.prof.verbose_generic_activity("LLVM_fatlto");

let dcx = DiagCtxt::new(Box::new(shared_emitter.clone()));
let dcx = dcx.handle();

check_lto_allowed(&cgcx, dcx);

B::optimize_and_codegen_fat_lto(
sess,
cgcx,
prof,
&shared_emitter,
tm_factory,
exported_symbols_for_lto,
Expand Down Expand Up @@ -2177,8 +2177,8 @@ impl<B: WriteBackendMethods> OngoingCodegen<B> {

CompiledModules {
modules: vec![do_fat_lto(
sess,
&cgcx,
&sess.prof,
shared_emitter,
tm_factory,
&exported_symbols_for_lto,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/traits/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ pub trait WriteBackendMethods: Clone + 'static {
/// Performs fat LTO by merging all modules into a single one, running autodiff
/// if necessary and running any further optimizations
fn optimize_and_codegen_fat_lto(
sess: &Session,
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
shared_emitter: &SharedEmitter,
tm_factory: TargetMachineFactoryFn<Self>,
exported_symbols_for_lto: &[String],
Expand Down
Loading