trans: Only instantiate #[inline] functions in codegen units referencing them This PR changes how `#[inline]` functions are translated. Before, there was one "master instance" of the function with `external` linkage and a number of on-demand instances with `available_externally` linkage in each codegen unit that referenced the function. This had two downsides: * Public functions marked with `#[inline]` would be present in machine code of libraries unnecessarily (see #36280 for an example) * LLVM would crash on `i686-pc-windows-msvc` due to what I suspect to be a bug in LLVM's Win32 exception handling code, because it doesn't like `available_externally` there (#36309). This PR changes the behavior, so that there is no master instance and only on-demand instances with `internal` linkage. The downside of this is potential code-bloat if LLVM does not completely inline away the `internal` instances because then there'd be N instances of the function instead of 1. However, this can only become a problem when using more than one codegen unit per crate. cc @rust-lang/compiler |
||
|---|---|---|
| .. | ||
| auxiliary | ||
| extern-drop-glue.rs | ||
| extern-generic.rs | ||
| inlining-from-extern-crate.rs | ||
| local-drop-glue.rs | ||
| local-generic.rs | ||
| local-inlining.rs | ||
| local-transitive-inlining.rs | ||
| methods-are-with-self-type.rs | ||
| regular-modules.rs | ||
| statics.rs | ||
| vtable-through-const.rs | ||