aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-05-22 17:33:44 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-05-22 17:33:44 +0000
commit3a5f5c57e0a262207f7cb721a60df3676ab5209f (patch)
tree411cd6f8085a965d8ced31fd6d84ca628dc9b094 /lib
parentcd1876207f5564beba74e4b2524b664bdba0ba9f (diff)
x86_64 ABI: Account for sret parameters consuming an integer register.
- PR4242. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72268 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/CGCall.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index 356caa3f90..ce98f8c256 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -1055,6 +1055,11 @@ void X86_64ABIInfo::computeInfo(CGFunctionInfo &FI, ASTContext &Context) const {
// Keep track of the number of assigned registers.
unsigned freeIntRegs = 6, freeSSERegs = 8;
+
+ // If the return value is indirect, then the hidden argument is consuming one
+ // integer register.
+ if (FI.getReturnInfo().isIndirect())
+ --freeIntRegs;
// AMD64-ABI 3.2.3p3: Once arguments are classified, the registers
// get assigned (in left-to-right order) for passing as follows...