Special case allocator module submission to avoid special casing it elsewhere

A lot of places had special handling just in case they would get an
allocator module even though most of these places could never get one or
would have a trivial implementation for the allocator module. Moving all
handling of the allocator module to a single place simplifies things a
fair bit.
This commit is contained in:
bjorn3
2025-08-28 10:26:29 +00:00
parent eea81b5d75
commit 319fe230f0
6 changed files with 79 additions and 146 deletions

View File

@@ -204,7 +204,7 @@ fn fat_lto(
let path = tmp_path.path().to_path_buf().join(&module.name);
let path = path.to_str().expect("path");
let context = &module.module_llvm.context;
let config = cgcx.config(module.kind);
let config = &cgcx.module_config;
// NOTE: we need to set the optimization level here in order for LTO to do its job.
context.set_optimization_level(to_gcc_opt_level(config.opt_level));
context.add_command_line_option("-flto=auto");