1 //=- RISCVMachineFunctionInfo.h - RISCV 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 RISCV-specific per-machine-function information. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H 15 #define LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H 16 17 #include "llvm/CodeGen/MachineFunction.h" 18 19 namespace llvm { 20 21 /// RISCVMachineFunctionInfo - This class is derived from MachineFunctionInfo 22 /// and contains private RISCV-specific information for each MachineFunction. 23 class RISCVMachineFunctionInfo : public MachineFunctionInfo { 24 25 /// FrameIndex for start of varargs area 26 int VarArgsFrameIndex = 0; 27 /// Size of the save area used for varargs 28 int VarArgsSaveSize = 0; 29 30 public: 31 RISCVMachineFunctionInfo() = default; 32 33 explicit RISCVMachineFunctionInfo(MachineFunction &MF) {} 34 35 int getVarArgsFrameIndex() const { return VarArgsFrameIndex; } 36 void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; } 37 38 unsigned getVarArgsSaveSize() const { return VarArgsSaveSize; } 39 void setVarArgsSaveSize(int Size) { VarArgsSaveSize = Size; } 40 }; 41 42 } // end namespace llvm 43 44 #endif // LLVM_LIB_TARGET_RISCV_RISCVMACHINEFUNCTIONINFO_H 45