summaryrefslogtreecommitdiff
path: root/lib/Target/XCore/XCoreCallingConv.td
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2014-02-27 17:47:54 +0000
committerRichard Osborne <richard@xmos.com>2014-02-27 17:47:54 +0000
commitcc331c8f40107934b4bfa36d3646126bc0c4a412 (patch)
treef867df815194a68cc433659c8c4b73325e663193 /lib/Target/XCore/XCoreCallingConv.td
parent870d997d8cd300b266e3157cddda357a80d702d5 (diff)
downloadllvm-cc331c8f40107934b4bfa36d3646126bc0c4a412.tar.gz
llvm-cc331c8f40107934b4bfa36d3646126bc0c4a412.tar.bz2
llvm-cc331c8f40107934b4bfa36d3646126bc0c4a412.tar.xz
[XCore] Support functions returning more than 4 words.
If a function returns a large struct by value return the first 4 words in registers and the rest on the stack in a location reserved by the caller. This is needed to support the xC language which supports functions returning an arbitrary number of return values. This is r202397 reapplied with a fix to avoid an uninitialized read of a member. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/XCore/XCoreCallingConv.td')
-rw-r--r--lib/Target/XCore/XCoreCallingConv.td6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Target/XCore/XCoreCallingConv.td b/lib/Target/XCore/XCoreCallingConv.td
index b20d71f49c..e149e6d9ec 100644
--- a/lib/Target/XCore/XCoreCallingConv.td
+++ b/lib/Target/XCore/XCoreCallingConv.td
@@ -14,7 +14,11 @@
//===----------------------------------------------------------------------===//
def RetCC_XCore : CallingConv<[
// i32 are returned in registers R0, R1, R2, R3
- CCIfType<[i32], CCAssignToReg<[R0, R1, R2, R3]>>
+ CCIfType<[i32], CCAssignToReg<[R0, R1, R2, R3]>>,
+
+ // Integer values get stored in stack slots that are 4 bytes in
+ // size and 4-byte aligned.
+ CCIfType<[i32], CCAssignToStack<4, 4>>
]>;
//===----------------------------------------------------------------------===//