137564d825
rustc: Handle modules in "fat" LTO more robustly When performing a "fat" LTO the compiler has a whole mess of codegen units that it links together. To do this it needs to select one module as a "base" module and then link everything else into this module. Previously LTO passes assume that there's at least one module in-memory to link into, but nowadays that's not always true! With incremental compilation modules may actually largely be cached and it may be possible that there's no in-memory modules to work with. This commit updates the logic of the LTO backend to handle modules a bit more uniformly during a fat LTO. This commit immediately splits them into two lists, one serialized and one in-memory. The in-memory list is then searched for the largest module and failing that we simply deserialize the first serialized module and link into that. This refactoring avoids juggling three lists, two of which are serialized modules and one of which is half serialized and half in-memory. Closes #63349 |
||
---|---|---|
.. | ||
back | ||
debuginfo | ||
llvm | ||
abi.rs | ||
allocator.rs | ||
asm.rs | ||
attributes.rs | ||
base.rs | ||
build.rs | ||
builder.rs | ||
callee.rs | ||
Cargo.toml | ||
common.rs | ||
consts.rs | ||
context.rs | ||
declare.rs | ||
error_codes.rs | ||
intrinsic.rs | ||
lib.rs | ||
llvm_util.rs | ||
metadata.rs | ||
mono_item.rs | ||
README.md | ||
type_.rs | ||
type_of.rs | ||
va_arg.rs | ||
value.rs |
The codegen
crate contains the code to convert from MIR into LLVM IR,
and then from LLVM IR into machine code. In general it contains code
that runs towards the end of the compilation process.
For more information about how codegen works, see the rustc guide.