1 //===- LanaiMachineFuctionInfo.h - Lanai machine func info -------*- C++ -*-==// 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 Lanai-specific per-machine-function information. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef LLVM_LIB_TARGET_LANAI_LANAIMACHINEFUNCTIONINFO_H 14 #define LLVM_LIB_TARGET_LANAI_LANAIMACHINEFUNCTIONINFO_H 15 16 #include "LanaiRegisterInfo.h" 17 #include "llvm/CodeGen/MachineFunction.h" 18 #include "llvm/CodeGen/MachineRegisterInfo.h" 19 20 namespace llvm { 21 22 // LanaiMachineFunctionInfo - This class is derived from MachineFunction and 23 // contains private Lanai target-specific information for each MachineFunction. 24 class LanaiMachineFunctionInfo : public MachineFunctionInfo { 25 virtual void anchor(); 26 27 MachineFunction &MF; 28 29 // SRetReturnReg - Lanai ABI require that sret lowering includes 30 // returning the value of the returned struct in a register. This field 31 // holds the virtual register into which the sret argument is passed. 32 unsigned SRetReturnReg; 33 34 // GlobalBaseReg - keeps track of the virtual register initialized for 35 // use as the global base register. This is used for PIC in some PIC 36 // relocation models. 37 unsigned GlobalBaseReg; 38 39 // VarArgsFrameIndex - FrameIndex for start of varargs area. 40 int VarArgsFrameIndex; 41 42 public: 43 explicit LanaiMachineFunctionInfo(MachineFunction &MF) 44 : MF(MF), SRetReturnReg(0), GlobalBaseReg(0), VarArgsFrameIndex(0) {} 45 46 unsigned getSRetReturnReg() const { return SRetReturnReg; } 47 void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; } 48 49 unsigned getGlobalBaseReg(); 50 51 int getVarArgsFrameIndex() const { return VarArgsFrameIndex; } 52 void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; } 53 }; 54 55 } // namespace llvm 56 57 #endif // LLVM_LIB_TARGET_LANAI_LANAIMACHINEFUNCTIONINFO_H 58