summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit521bdf211deb77812e6f3574b3f40095371c0699 (patch)
tree2b1afb9d77d4433908200461737910e664762767 /llvm/lib/Target/XCore/XCoreCallingConv.td
parentf474087f98597c8ea4691e5beca7dccfc0778a0c (diff)
downloadbcm5719-llvm-521bdf211deb77812e6f3574b3f40095371c0699.tar.gz
bcm5719-llvm-521bdf211deb77812e6f3574b3f40095371c0699.zip
[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. llvm-svn: 202414
Diffstat (limited to 'llvm/lib/Target/XCore/XCoreCallingConv.td')
-rw-r--r--llvm/lib/Target/XCore/XCoreCallingConv.td6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Target/XCore/XCoreCallingConv.td b/llvm/lib/Target/XCore/XCoreCallingConv.td
index b20d71f49cf..e149e6d9ec2 100644
--- a/llvm/lib/Target/XCore/XCoreCallingConv.td
+++ b/llvm/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>>
]>;
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud