diff options
author | Richard Osborne <richard@xmos.com> | 2014-02-27 14:00:40 +0000 |
---|---|---|
committer | Richard Osborne <richard@xmos.com> | 2014-02-27 14:00:40 +0000 |
commit | e82bf0988e8eb75dea0b32f29153495c532073ad (patch) | |
tree | dbfeae3d39041eeda1b78ad9788cfacac45cb0d3 /llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h | |
parent | ed7e2ad090ce234ebdda79edde8dc344e39d757e (diff) | |
download | bcm5719-llvm-e82bf0988e8eb75dea0b32f29153495c532073ad.tar.gz bcm5719-llvm-e82bf0988e8eb75dea0b32f29153495c532073ad.zip |
[XCore] Support functions returning more than 4 words.
Summary:
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.
Reviewers: robertlytton
Reviewed By: robertlytton
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2889
llvm-svn: 202397
Diffstat (limited to 'llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h')
-rw-r--r-- | llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h b/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h index f1777a87e11..2649300b44d 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) {} @@ -78,6 +81,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() { |