summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h
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/XCoreMachineFunctionInfo.h
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/XCoreMachineFunctionInfo.h')
-rw-r--r--llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h b/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h
index f1777a87e11..afbec652851 100644
--- a/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h
+++ b/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h
@@ -33,6 +33,8 @@ class XCoreFunctionInfo : public MachineFunctionInfo {
int FPSpillSlot;
bool EHSpillSlotSet;
int EHSpillSlot[2];
+ unsigned ReturnStackOffset;
+ bool ReturnStackOffsetSet;
int VarArgsFrameIndex;
mutable int CachedEStackSize;
std::vector<std::pair<MCSymbol*, CalleeSavedInfo> > SpillLabels;
@@ -42,6 +44,7 @@ public:
LRSpillSlotSet(false),
FPSpillSlotSet(false),
EHSpillSlotSet(false),
+ ReturnStackOffsetSet(false),
VarArgsFrameIndex(0),
CachedEStackSize(-1) {}
@@ -49,6 +52,7 @@ public:
LRSpillSlotSet(false),
FPSpillSlotSet(false),
EHSpillSlotSet(false),
+ ReturnStackOffsetSet(false),
VarArgsFrameIndex(0),
CachedEStackSize(-1) {}
@@ -78,6 +82,17 @@ public:
return EHSpillSlot;
}
+ void setReturnStackOffset(unsigned value) {
+ assert(!ReturnStackOffsetSet && "Return stack offset set twice");
+ ReturnStackOffset = value;
+ ReturnStackOffsetSet = true;
+ }
+
+ unsigned getReturnStackOffset() const {
+ assert(ReturnStackOffsetSet && "Return stack offset not set");
+ return ReturnStackOffset;
+ }
+
bool isLargeFrame(const MachineFunction &MF) const;
std::vector<std::pair<MCSymbol*, CalleeSavedInfo> > &getSpillLabels() {
OpenPOWER on IntegriCloud