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: Nios2FunctionInfo()40 Nios2FunctionInfo() 41 : GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0), 42 IsLeafProc(false) {} Nios2FunctionInfo(MachineFunction & MF)43 explicit Nios2FunctionInfo(MachineFunction &MF) 44 : GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0), 45 IsLeafProc(false) {} 46 getGlobalBaseReg()47 unsigned getGlobalBaseReg() const { return GlobalBaseReg; } setGlobalBaseReg(unsigned Reg)48 void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; } 49 getVarArgsFrameOffset()50 int getVarArgsFrameOffset() const { return VarArgsFrameOffset; } setVarArgsFrameOffset(int Offset)51 void setVarArgsFrameOffset(int Offset) { VarArgsFrameOffset = Offset; } 52 getSRetReturnReg()53 unsigned getSRetReturnReg() const { return SRetReturnReg; } setSRetReturnReg(unsigned Reg)54 void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; } 55 setLeafProc(bool rhs)56 void setLeafProc(bool rhs) { IsLeafProc = rhs; } isLeafProc()57 bool isLeafProc() const { return IsLeafProc; } 58 }; 59 60 } // end of namespace llvm 61 62 #endif // NIOS2_MACHINE_FUNCTION_INFO_H 63