summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86CallingConv.h
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-05-09 22:56:42 +0000
committerReid Kleckner <reid@kleckner.net>2014-05-09 22:56:42 +0000
commitd30c11eddee0c6f17a65303c249b77d14962c973 (patch)
treea204ca35123d20da51f2add45cfad7bc9bb6fda2 /lib/Target/X86/X86CallingConv.h
parent754e940865aaf63be79dcb921572eff4b1042c7c (diff)
downloadllvm-d30c11eddee0c6f17a65303c249b77d14962c973.tar.gz
llvm-d30c11eddee0c6f17a65303c249b77d14962c973.tar.bz2
llvm-d30c11eddee0c6f17a65303c249b77d14962c973.tar.xz
Revert "[ms-cxxabi] Add a new calling convention that swaps 'this' and 'sret'"
This reverts commit r200561. This calling convention was an attempt to match the MSVC C++ ABI for methods that return structures by value. This solution didn't scale, because it would have required splitting every CC available on Windows into two: one for methods and one for free functions. Now that we can put sret on the second arg (r208453), and Clang does that (r208458), revert this hack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86CallingConv.h')
-rw-r--r--lib/Target/X86/X86CallingConv.h27
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/Target/X86/X86CallingConv.h b/lib/Target/X86/X86CallingConv.h
index 040da3535e..e76f9fda2d 100644
--- a/lib/Target/X86/X86CallingConv.h
+++ b/lib/Target/X86/X86CallingConv.h
@@ -29,33 +29,6 @@ inline bool CC_X86_AnyReg_Error(unsigned &, MVT &, MVT &,
return false;
}
-inline bool CC_X86_CDeclMethod_SRet(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
- CCValAssign::LocInfo &LocInfo,
- ISD::ArgFlagsTy &ArgFlags, CCState &State) {
- // Swap the order of the first two parameters if the first parameter is sret.
- if (ArgFlags.isSRet()) {
- assert(ValNo == 0);
- assert(ValVT == MVT::i32);
- State.AllocateStack(8, 4);
- State.addLoc(CCValAssign::getCustomMem(ValNo, ValVT, 4, LocVT, LocInfo));
-
- // Indicate that we need to swap the order of the first and second
- // parameters by "allocating" register zero. There are no register
- // parameters with cdecl methods, so we can use this to communicate to the
- // next call.
- State.AllocateReg(1);
- return true;
- } else if (ValNo == 1 && State.isAllocated(1)) {
- assert(ValVT == MVT::i32 && "non-i32-sized this param unsupported");
- // Stack was already allocated while processing sret.
- State.addLoc(CCValAssign::getCustomMem(ValNo, ValVT, 0, LocVT, LocInfo));
- return true;
- }
-
- // All other args use the C calling convention.
- return false;
-}
-
} // End llvm namespace
#endif