Skip to content

Commit 7b50b49

Browse files
committed
Auto merge of #145955 - bjorn3:lto_refactors4, r=nnethercote
Rework how the codegen coordinator code handles the allocator shim Continuing from rust-lang/rust#144503 this centralizes most handling of the allocator shim to a single 4 line block in the codegen coordinator. The allocator shim is small enough that making it go through the main codegen loop and spawning a worker thread for it is wasted effort.
2 parents b8a2607 + 4dcd901 commit 7b50b49

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/back/lto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ fn fat_lto(
204204
let path = tmp_path.path().to_path_buf().join(&module.name);
205205
let path = path.to_str().expect("path");
206206
let context = &module.module_llvm.context;
207-
let config = cgcx.config(module.kind);
207+
let config = &cgcx.module_config;
208208
// NOTE: we need to set the optimization level here in order for LTO to do its job.
209209
context.set_optimization_level(to_gcc_opt_level(config.opt_level));
210210
context.add_command_line_option("-flto=auto");

0 commit comments

Comments
 (0)