xref: /netbsd-src/external/apache2/llvm/dist/llvm/lib/Target/Sparc/SparcMachineFunctionInfo.h (revision 82d56013d7b633d116a93943de88e08335357a7c)
1 //===- SparcMachineFunctionInfo.h - Sparc 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  Sparc specific per-machine-function information.
10 //
11 //===----------------------------------------------------------------------===//
12 #ifndef LLVM_LIB_TARGET_SPARC_SPARCMACHINEFUNCTIONINFO_H
13 #define LLVM_LIB_TARGET_SPARC_SPARCMACHINEFUNCTIONINFO_H
14 
15 #include "llvm/CodeGen/MachineFunction.h"
16 
17 namespace llvm {
18 
19   class SparcMachineFunctionInfo : public MachineFunctionInfo {
20     virtual void anchor();
21   private:
22     Register GlobalBaseReg;
23 
24     /// VarArgsFrameOffset - Frame offset to start of varargs area.
25     int VarArgsFrameOffset;
26 
27     /// SRetReturnReg - Holds the virtual register into which the sret
28     /// argument is passed.
29     Register SRetReturnReg;
30 
31     /// IsLeafProc - True if the function is a leaf procedure.
32     bool IsLeafProc;
33   public:
SparcMachineFunctionInfo()34     SparcMachineFunctionInfo()
35       : GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0),
36         IsLeafProc(false) {}
SparcMachineFunctionInfo(MachineFunction & MF)37     explicit SparcMachineFunctionInfo(MachineFunction &MF)
38       : GlobalBaseReg(0), VarArgsFrameOffset(0), SRetReturnReg(0),
39         IsLeafProc(false) {}
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 
getSRetReturnReg()47     Register getSRetReturnReg() const { return SRetReturnReg; }
setSRetReturnReg(Register Reg)48     void setSRetReturnReg(Register Reg) { SRetReturnReg = Reg; }
49 
setLeafProc(bool rhs)50     void setLeafProc(bool rhs) { IsLeafProc = rhs; }
isLeafProc()51     bool isLeafProc() const { return IsLeafProc; }
52   };
53 }
54 
55 #endif
56