Don't setup inalloca for swiftcc on i686-windows-msvc
authorReid Kleckner <rnk@google.com>
Tue, 8 Dec 2020 19:54:11 +0000 (11:54 -0800)
committerReid Kleckner <rnk@google.com>
Wed, 9 Dec 2020 19:08:48 +0000 (11:08 -0800)
commitdf282215d497e15104ae9e182e083cdfa0bae3c2
tree2915ed23a495af31913abb7b7af1f5b30131da93
parentd7098ff29c58dd08ede8314818b7de7fd2fea4cc
Don't setup inalloca for swiftcc on i686-windows-msvc

Swiftcall does it's own target-independent argument type classification,
since it is not designed to be ABI compatible with anything local on the
target that isn't LLVM-based. This means it never uses inalloca.
However, we have duplicate logic for checking for inalloca parameters
that runs before call argument setup. This logic needs to know ahead of
time if inalloca will be used later, and we can't move the
CGFunctionInfo calculation earlier.

This change gets the calling convention from either the
FunctionProtoType or ObjCMethodDecl, checks if it is swift, and if so
skips the stackbase setup.

Depends on D92883.

Differential Revision: https://reviews.llvm.org/D92944
clang/lib/CodeGen/CGCall.cpp
clang/test/CodeGenCXX/windows-x86-swiftcall.cpp [new file with mode: 0644]