Commits

Slava Pestov committed 267b3faffb2
IRGen: Fix calling convention for functions with multiple indirect returns The recent change to destructure tuples in SIL function return types introduced some runtime changes where it was assumed that a SIL function type like $@convention(thin) () -> (@out X, @out Y) Would have the same calling convention as the following C function: void foo(void *X, void *Y); Unfortunately, this only worked on x86-64, because the first @out parameter in a SIL function type was lowered with the LLVM 'sret' attribute, which on i386 and ARM64 is not the same as the first parameter to a function. On i386, this manifested as a crash in a variety of executable tests with a misaligned stack; on ARM64, a similar crash would occur because the return value was initialized through the wrong register. Hack around this by simply disabling 'sret' if a SIL function type has multiple indirect return values. Fixes <rdar://problem/24727411>.