1 //=- LoongArchMachineFunctionInfo.h - LoongArch machine function info -----===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file declares LoongArch-specific per-machine-function information. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef LLVM_LIB_TARGET_LOONGARCH_LOONGARCHMACHINEFUNCTIONINFO_H 14 #define LLVM_LIB_TARGET_LOONGARCH_LOONGARCHMACHINEFUNCTIONINFO_H 15 16 #include "LoongArchSubtarget.h" 17 #include "llvm/CodeGen/MachineFrameInfo.h" 18 #include "llvm/CodeGen/MachineFunction.h" 19 20 namespace llvm { 21 22 /// LoongArchMachineFunctionInfo - This class is derived from 23 /// MachineFunctionInfo and contains private LoongArch-specific information for 24 /// each MachineFunction. 25 class LoongArchMachineFunctionInfo : public MachineFunctionInfo { 26 private: 27 /// FrameIndex for start of varargs area 28 int VarArgsFrameIndex = 0; 29 /// Size of the save area used for varargs 30 int VarArgsSaveSize = 0; 31 32 /// Size of stack frame to save callee saved registers 33 unsigned CalleeSavedStackSize = 0; 34 35 public: 36 LoongArchMachineFunctionInfo(const MachineFunction &MF) {} 37 38 MachineFunctionInfo * 39 clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, 40 const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB) 41 const override { 42 return DestMF.cloneInfo<LoongArchMachineFunctionInfo>(*this); 43 } 44 45 int getVarArgsFrameIndex() const { return VarArgsFrameIndex; } 46 void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; } 47 48 unsigned getVarArgsSaveSize() const { return VarArgsSaveSize; } 49 void setVarArgsSaveSize(int Size) { VarArgsSaveSize = Size; } 50 51 unsigned getCalleeSavedStackSize() const { return CalleeSavedStackSize; } 52 void setCalleeSavedStackSize(unsigned Size) { CalleeSavedStackSize = Size; } 53 }; 54 55 } // end namespace llvm 56 57 #endif // LLVM_LIB_TARGET_LOONGARCH_LOONGARCHMACHINEFUNCTIONINFO_H 58