mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
[ms-cxxabi] Add a new calling convention that swaps 'this' and 'sret'
MSVC always places the 'this' parameter for a method first. The implicit 'sret' pointer for methods always comes second. We already implement this for __thiscall by putting sret parameters on the stack, but __cdecl methods require putting both parameters on the stack in opposite order. Using a special calling convention allows frontends to keep the sret parameter first, which avoids breaking lots of assumptions in LLVM and Clang. Fixes PR15768 with the corresponding change in Clang. Reviewers: ributzka, majnemer Differential Revision: http://llvm-reviews.chandlerc.com/D2663 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200561 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -78,6 +78,7 @@ static void PrintCallingConv(unsigned cc, raw_ostream &Out) {
|
||||
case CallingConv::X86_StdCall: Out << "x86_stdcallcc"; break;
|
||||
case CallingConv::X86_FastCall: Out << "x86_fastcallcc"; break;
|
||||
case CallingConv::X86_ThisCall: Out << "x86_thiscallcc"; break;
|
||||
case CallingConv::X86_CDeclMethod:Out << "x86_cdeclmethodcc"; break;
|
||||
case CallingConv::Intel_OCL_BI: Out << "intel_ocl_bicc"; break;
|
||||
case CallingConv::ARM_APCS: Out << "arm_apcscc"; break;
|
||||
case CallingConv::ARM_AAPCS: Out << "arm_aapcscc"; break;
|
||||
|
||||
Reference in New Issue
Block a user