summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h
diff options
context:
space:
mode:
authorVadzim Dambrouski <pftbest@gmail.com>2017-03-02 20:25:10 +0000
committerVadzim Dambrouski <pftbest@gmail.com>2017-03-02 20:25:10 +0000
commiteafb8055061000146c88989cbec7d4cd80294051 (patch)
treefe8ade37a6e2ed8772c8d3ca6a25353edaa9aa63 /llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h
parent5ad740756f7a61e6ee58727df8e40e1ba1af5986 (diff)
downloadbcm5719-llvm-eafb8055061000146c88989cbec7d4cd80294051.tar.gz
bcm5719-llvm-eafb8055061000146c88989cbec7d4cd80294051.zip
[MSP430] Add SRet support to MSP430 target
This patch adds support for struct return values to the MSP430 target backend. It also reverses the order of argument and return registers in the calling convention to bring it into closer alignment with the published EABI from TI. Patch by Andrew Wygle (awygle). Differential Revision: https://reviews.llvm.org/D29069 llvm-svn: 296807
Diffstat (limited to 'llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h')
-rw-r--r--llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h b/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h
index 2d937318c7e..fcaa8a1d6c7 100644
--- a/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h
+++ b/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h
@@ -33,15 +33,23 @@ class MSP430MachineFunctionInfo : public MachineFunctionInfo {
/// VarArgsFrameIndex - FrameIndex for start of varargs area.
int VarArgsFrameIndex;
+ /// SRetReturnReg - Some subtargets require that sret lowering includes
+ /// returning the value of the returned struct in a register. This field
+ /// holds the virtual register into which the sret argument is passed.
+ unsigned SRetReturnReg;
+
public:
MSP430MachineFunctionInfo() : CalleeSavedFrameSize(0) {}
explicit MSP430MachineFunctionInfo(MachineFunction &MF)
- : CalleeSavedFrameSize(0), ReturnAddrIndex(0) {}
+ : CalleeSavedFrameSize(0), ReturnAddrIndex(0), SRetReturnReg(0) {}
unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; }
+ unsigned getSRetReturnReg() const { return SRetReturnReg; }
+ void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
+
int getRAIndex() const { return ReturnAddrIndex; }
void setRAIndex(int Index) { ReturnAddrIndex = Index; }
OpenPOWER on IntegriCloud