xref: /freebsd/contrib/llvm-project/llvm/lib/Target/VE/VEMachineFunctionInfo.h (revision bdd1243df58e60e85101c09001d9812a789b6bc4)
1 //===- VEMachineFunctionInfo.h - VE Machine Function 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  VE specific per-machine-function information.
10 //
11 //===----------------------------------------------------------------------===//
12 #ifndef LLVM_LIB_TARGET_VE_VEMACHINEFUNCTIONINFO_H
13 #define LLVM_LIB_TARGET_VE_VEMACHINEFUNCTIONINFO_H
14 
15 #include "llvm/CodeGen/MachineFunction.h"
16 
17 namespace llvm {
18 
19 class VEMachineFunctionInfo : public MachineFunctionInfo {
20   virtual void anchor();
21 
22 private:
23   Register GlobalBaseReg;
24 
25   /// VarArgsFrameOffset - Frame offset to start of varargs area.
26   int VarArgsFrameOffset;
27 
28   /// IsLeafProc - True if the function is a leaf procedure.
29   bool IsLeafProc;
30 
31 public:
VEMachineFunctionInfo()32   VEMachineFunctionInfo() : VarArgsFrameOffset(0), IsLeafProc(false) {}
VEMachineFunctionInfo(const Function & F,const TargetSubtargetInfo * STI)33   VEMachineFunctionInfo(const Function &F, const TargetSubtargetInfo *STI)
34       : VarArgsFrameOffset(0), IsLeafProc(false) {}
35 
36   MachineFunctionInfo *
37   clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF,
38         const DenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
39       const override;
40 
getGlobalBaseReg()41   Register getGlobalBaseReg() const { return GlobalBaseReg; }
setGlobalBaseReg(Register Reg)42   void setGlobalBaseReg(Register Reg) { GlobalBaseReg = Reg; }
43 
getVarArgsFrameOffset()44   int getVarArgsFrameOffset() const { return VarArgsFrameOffset; }
setVarArgsFrameOffset(int Offset)45   void setVarArgsFrameOffset(int Offset) { VarArgsFrameOffset = Offset; }
46 
setLeafProc(bool rhs)47   void setLeafProc(bool rhs) { IsLeafProc = rhs; }
isLeafProc()48   bool isLeafProc() const { return IsLeafProc; }
49 };
50 } // namespace llvm
51 
52 #endif
53