Chris Lattner | ea7fd96 | 2009-09-15 18:03:13 +0000 | [diff] [blame] | 1 | //===- SparcMachineFunctionInfo.h - Sparc Machine Function Info -*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file declares Sparc specific per-machine-function information. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | #ifndef SPARCMACHINEFUNCTIONINFO_H |
| 14 | #define SPARCMACHINEFUNCTIONINFO_H |
| 15 | |
| 16 | #include "llvm/CodeGen/MachineFunction.h" |
| 17 | |
| 18 | namespace llvm { |
| 19 | |
| 20 | class SparcMachineFunctionInfo : public MachineFunctionInfo { |
David Blaikie | 2d24e2a | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 21 | virtual void anchor(); |
Chris Lattner | ea7fd96 | 2009-09-15 18:03:13 +0000 | [diff] [blame] | 22 | private: |
| 23 | unsigned GlobalBaseReg; |
Dan Gohman | 1e93df6 | 2010-04-17 14:41:14 +0000 | [diff] [blame] | 24 | |
| 25 | /// VarArgsFrameOffset - Frame offset to start of varargs area. |
| 26 | int VarArgsFrameOffset; |
| 27 | |
Venkatraman Govindaraju | 8184e28 | 2011-01-22 13:05:16 +0000 | [diff] [blame] | 28 | /// SRetReturnReg - Holds the virtual register into which the sret |
| 29 | /// argument is passed. |
| 30 | unsigned SRetReturnReg; |
Venkatraman Govindaraju | 5300869 | 2013-05-29 04:46:31 +0000 | [diff] [blame^] | 31 | |
| 32 | /// IsLeafProc - True if the function is a leaf procedure. |
| 33 | bool IsLeafProc; |
Chris Lattner | ea7fd96 | 2009-09-15 18:03:13 +0000 | [diff] [blame] | 34 | public: |
Venkatraman Govindaraju | 8184e28 | 2011-01-22 13:05:16 +0000 | [diff] [blame] | 35 | SparcMachineFunctionInfo() |
Venkatraman Govindaraju | 5300869 | 2013-05-29 04:46:31 +0000 | [diff] [blame^] | 36 | : GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0), |
| 37 | IsLeafProc(false) {} |
Dan Gohman | 1e93df6 | 2010-04-17 14:41:14 +0000 | [diff] [blame] | 38 | explicit SparcMachineFunctionInfo(MachineFunction &MF) |
Venkatraman Govindaraju | 5300869 | 2013-05-29 04:46:31 +0000 | [diff] [blame^] | 39 | : GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0), |
| 40 | IsLeafProc(false) {} |
Chris Lattner | ea7fd96 | 2009-09-15 18:03:13 +0000 | [diff] [blame] | 41 | |
| 42 | unsigned getGlobalBaseReg() const { return GlobalBaseReg; } |
| 43 | void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; } |
Dan Gohman | 1e93df6 | 2010-04-17 14:41:14 +0000 | [diff] [blame] | 44 | |
| 45 | int getVarArgsFrameOffset() const { return VarArgsFrameOffset; } |
| 46 | void setVarArgsFrameOffset(int Offset) { VarArgsFrameOffset = Offset; } |
Venkatraman Govindaraju | 8184e28 | 2011-01-22 13:05:16 +0000 | [diff] [blame] | 47 | |
| 48 | unsigned getSRetReturnReg() const { return SRetReturnReg; } |
| 49 | void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; } |
Venkatraman Govindaraju | 5300869 | 2013-05-29 04:46:31 +0000 | [diff] [blame^] | 50 | |
| 51 | void setLeafProc(bool rhs) { IsLeafProc = rhs; } |
| 52 | bool isLeafProc() const { return IsLeafProc; } |
Chris Lattner | ea7fd96 | 2009-09-15 18:03:13 +0000 | [diff] [blame] | 53 | }; |
| 54 | } |
| 55 | |
| 56 | #endif |