Nikolai Bozhenov | 1cf9c54 | 2017-12-07 12:35:02 +0000 | [diff] [blame] | 1 | //===-- Nios2MachineFunctionInfo.h - Private data used for Nios2 --*- 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 the Nios2 specific subclass of MachineFunctionInfo. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_LIB_TARGET_NIOS2_NIOS2MACHINEFUNCTION_H |
| 15 | #define LLVM_LIB_TARGET_NIOS2_NIOS2MACHINEFUNCTION_H |
| 16 | |
| 17 | #include "llvm/CodeGen/MachineFunction.h" |
| 18 | |
| 19 | namespace llvm { |
| 20 | |
| 21 | /// Nios2FunctionInfo - This class is derived from MachineFunction private |
| 22 | /// Nios2 target-specific information for each MachineFunction. |
| 23 | class Nios2FunctionInfo : public MachineFunctionInfo { |
| 24 | virtual void anchor(); |
| 25 | |
| 26 | private: |
| 27 | unsigned GlobalBaseReg; |
| 28 | |
| 29 | /// VarArgsFrameOffset - Frame offset to start of varargs area. |
| 30 | int VarArgsFrameOffset; |
| 31 | |
| 32 | /// SRetReturnReg - Holds the virtual register into which the sret |
| 33 | /// argument is passed. |
| 34 | unsigned SRetReturnReg; |
| 35 | |
| 36 | /// IsLeafProc - True if the function is a leaf procedure. |
| 37 | bool IsLeafProc; |
| 38 | |
| 39 | public: |
| 40 | Nios2FunctionInfo() |
| 41 | : GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0), |
| 42 | IsLeafProc(false) {} |
| 43 | explicit Nios2FunctionInfo(MachineFunction &MF) |
| 44 | : GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0), |
| 45 | IsLeafProc(false) {} |
| 46 | |
| 47 | unsigned getGlobalBaseReg() const { return GlobalBaseReg; } |
| 48 | void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; } |
| 49 | |
| 50 | int getVarArgsFrameOffset() const { return VarArgsFrameOffset; } |
| 51 | void setVarArgsFrameOffset(int Offset) { VarArgsFrameOffset = Offset; } |
| 52 | |
| 53 | unsigned getSRetReturnReg() const { return SRetReturnReg; } |
| 54 | void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; } |
| 55 | |
| 56 | void setLeafProc(bool rhs) { IsLeafProc = rhs; } |
| 57 | bool isLeafProc() const { return IsLeafProc; } |
| 58 | }; |
| 59 | |
| 60 | } // end of namespace llvm |
| 61 | |
| 62 | #endif // NIOS2_MACHINE_FUNCTION_INFO_H |