The layouts of resilient value types shipped in the Swift 5 standard library
x and overlays will forever be frozen in time for backward deployment to old
Objective-C runtimes. This PR ensures that even if the layouts of these types
evolve in the future, binaries built to run on the old runtime will continue
to lay out class instances in a manner compatible with Swift 5.
Fixes <rdar://problem/45646886>.
It hass been a longstanding principle in LLVM that the presence of
debug info shall not affect code generation. This patch brings the
Swift frontend closer to this ideal:
- unconditionally emit shadow copies
- unconditionally bind type metadata
The extra allocas, bitcasts, geps, and stores being emitted get
optimized away when compiling at anything but -Onone. There are few
use-cases for compiling at -Onone without -g, so this shouldn't affect
performance for any real-world use-cases.
When lowering the arguments for the FFI call on certain targets, LLVM
expects that the parameter be passed as a structure rather than the
extracted values. Enhance the argument lowering for the call and the
function construction to ensure that the type can be flattened according
to the ABI for the target before attempting to explode it for the SIL
IRGen lowering. This allows building for targets such as Linux ARM HF
and Linux ARM SF target with the HF floating point ABI.
Addresses SR-6142!