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