Add -Z combine_cgu flag

Introduce a compiler option to let rustc combines all regular CGUs into
a single one at the end of compilation.

Part of Issue #64191
This commit is contained in:
Victor Ding
2020-09-09 14:51:16 +10:00
parent e82584a77d
commit c81b43d8ac
6 changed files with 90 additions and 15 deletions

View File

@@ -13,6 +13,12 @@ pub trait WriteBackendMethods: 'static + Sized + Clone {
type ThinData: Send + Sync;
type ThinBuffer: ThinBufferMethods;
/// Merge all modules into main_module and returning it
fn run_link(
cgcx: &CodegenContext<Self>,
diag_handler: &Handler,
modules: Vec<ModuleCodegen<Self::Module>>,
) -> Result<ModuleCodegen<Self::Module>, FatalError>;
/// Performs fat LTO by merging all modules into a single one and returning it
/// for further optimization.
fn run_fat_lto(