rust/src/librustc_codegen_llvm
Mazdak Farrokhzad 137564d825
Rollup merge of #63956 - alexcrichton:fix-lto-all-cached, r=michaelwoerister
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
2019-08-29 17:14:01 +02:00
..
back rustc: Handle modules in "fat" LTO more robustly 2019-08-27 13:51:14 -07:00
debuginfo debuginfo: give unique names to closure and generator types 2019-08-25 13:12:24 +10:00
llvm Use Rust integer types instead of libc's fixed-width types 2019-08-01 17:01:33 +02:00
abi.rs
allocator.rs Merge rustc_allocator into libsyntax_ext 2019-07-24 12:27:58 +03:00
asm.rs Remove SyntaxContext from {ast, hir}::{GlobalAsm, InlineAsm} 2019-08-17 09:12:32 +01:00
attributes.rs
base.rs
build.rs
builder.rs Simplify change to layout_of 2019-08-03 22:04:39 -07:00
callee.rs
Cargo.toml Deduplicate rustc_demangle in librustc_codegen_llvm 2019-07-31 15:04:25 -07:00
common.rs Cast only where necessary 2019-08-17 11:29:17 +02:00
consts.rs CTFE: simplify Value type by not checking for alignment 2019-08-02 23:02:53 +02:00
context.rs tweak output and tests 2019-08-04 12:23:05 -07:00
declare.rs
error_codes.rs Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
intrinsic.rs Rename overflowing_{add,sub,mul} intrinsics to wrapping_{add,sub,mul}. 2019-08-16 20:04:21 +03:00
lib.rs rustc: Handle modules in "fat" LTO more robustly 2019-08-27 13:51:14 -07:00
llvm_util.rs
metadata.rs
mono_item.rs
README.md
type_.rs Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
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.