diff options
author | Reid Kleckner <reid@kleckner.net> | 2014-01-31 17:41:22 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2014-01-31 17:41:22 +0000 |
commit | 65c98b9da474d0562f883d6001f31ba5b2b95183 (patch) | |
tree | 18a2b8a062180aa9b4f289b5caa8db5e1d7aa061 /docs/CodeGenerator.rst | |
parent | 0cb94d9adc631eafa88218a5e972d45e0cf35f61 (diff) | |
download | llvm-65c98b9da474d0562f883d6001f31ba5b2b95183.tar.gz llvm-65c98b9da474d0562f883d6001f31ba5b2b95183.tar.bz2 llvm-65c98b9da474d0562f883d6001f31ba5b2b95183.tar.xz |
[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
Diffstat (limited to 'docs/CodeGenerator.rst')
-rw-r--r-- | docs/CodeGenerator.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/CodeGenerator.rst b/docs/CodeGenerator.rst index b89d2f426f..d7d98bc385 100644 --- a/docs/CodeGenerator.rst +++ b/docs/CodeGenerator.rst @@ -2145,6 +2145,10 @@ The following target-specific calling conventions are known to backend: others via stack. Callee is responsible for stack cleaning. This convention is used by MSVC by default for methods in its ABI (CC ID = 70). +* **X86_CDeclMethod** --- Identical to the standard x86_32 C calling convention, + except that an sret paramter, if present, is placed on the stack after the + second parameter, which must an integer or pointer. (CC ID = 80). + .. _X86 addressing mode: Representing X86 addressing modes in MachineInstrs |