rust/src/test/codegen-units/partitioning
bors 5cc6c6b1b7 Auto merge of #36524 - michaelwoerister:trans-inline-only-on-demand, r=nikomatsakis
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
2016-09-21 01:33:37 -07:00
..
auxiliary s/aux/auxiliary, because windows 2016-05-06 16:24:48 -04:00
extern-drop-glue.rs trans: Adjust linkage assignment so that we don't need weak linkage. 2016-07-08 10:42:48 -04:00
extern-generic.rs trans: Adjust linkage assignment so that we don't need weak linkage. 2016-07-08 10:42:48 -04:00
inlining-from-extern-crate.rs trans: Adjust linkage assignment so that we don't need weak linkage. 2016-07-08 10:42:48 -04:00
local-drop-glue.rs trans: Adjust linkage assignment so that we don't need weak linkage. 2016-07-08 10:42:48 -04:00
local-generic.rs trans: Adjust linkage assignment so that we don't need weak linkage. 2016-07-08 10:42:48 -04:00
local-inlining.rs Adapt codegen-unit test cases to new behaviour 2016-09-15 22:09:49 -04:00
local-transitive-inlining.rs Adapt codegen-unit test cases to new behaviour 2016-09-15 22:09:49 -04:00
methods-are-with-self-type.rs trans: Adjust linkage assignment so that we don't need weak linkage. 2016-07-08 10:42:48 -04:00
regular-modules.rs Improve linkage assignment in trans::partitioning. 2016-07-08 10:42:47 -04:00
statics.rs Improve linkage assignment in trans::partitioning. 2016-07-08 10:42:47 -04:00
vtable-through-const.rs trans: Let the collector find drop-glue for all vtables, not just VTableImpl. 2016-09-13 22:11:01 -04:00