comparison lib/Target/Mips/MipsMachineFunction.h @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents 1172e4bd9c6f
children c2174574ed3a
comparison
equal deleted inserted replaced
120:1172e4bd9c6f 121:803732b1fca8
1 //===-- MipsMachineFunctionInfo.h - Private data used for Mips ----*- C++ -*-=// 1 //===- MipsMachineFunctionInfo.h - Private data used for Mips ---*- C++ -*-===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
13 13
14 #ifndef LLVM_LIB_TARGET_MIPS_MIPSMACHINEFUNCTION_H 14 #ifndef LLVM_LIB_TARGET_MIPS_MIPSMACHINEFUNCTION_H
15 #define LLVM_LIB_TARGET_MIPS_MIPSMACHINEFUNCTION_H 15 #define LLVM_LIB_TARGET_MIPS_MIPSMACHINEFUNCTION_H
16 16
17 #include "Mips16HardFloatInfo.h" 17 #include "Mips16HardFloatInfo.h"
18 #include "llvm/CodeGen/MachineFrameInfo.h"
19 #include "llvm/CodeGen/MachineFunction.h" 18 #include "llvm/CodeGen/MachineFunction.h"
20 #include "llvm/CodeGen/MachineMemOperand.h" 19 #include "llvm/CodeGen/MachineMemOperand.h"
21 #include "llvm/CodeGen/PseudoSourceValue.h"
22 #include "llvm/Target/TargetFrameLowering.h"
23 #include "llvm/Target/TargetMachine.h"
24 #include <map> 20 #include <map>
25 21
26 namespace llvm { 22 namespace llvm {
27 23
28 /// MipsFunctionInfo - This class is derived from MachineFunction private 24 /// MipsFunctionInfo - This class is derived from MachineFunction private
29 /// Mips target-specific information for each MachineFunction. 25 /// Mips target-specific information for each MachineFunction.
30 class MipsFunctionInfo : public MachineFunctionInfo { 26 class MipsFunctionInfo : public MachineFunctionInfo {
31 public: 27 public:
32 MipsFunctionInfo(MachineFunction &MF) 28 MipsFunctionInfo(MachineFunction &MF) : MF(MF) {}
33 : MF(MF), SRetReturnReg(0), GlobalBaseReg(0), VarArgsFrameIndex(0),
34 CallsEhReturn(false), IsISR(false), SaveS2(false),
35 MoveF64ViaSpillFI(-1) {}
36 29
37 ~MipsFunctionInfo(); 30 ~MipsFunctionInfo() override;
38 31
39 unsigned getSRetReturnReg() const { return SRetReturnReg; } 32 unsigned getSRetReturnReg() const { return SRetReturnReg; }
40 void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; } 33 void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
41 34
42 bool globalBaseRegSet() const; 35 bool globalBaseRegSet() const;
79 void setSaveS2() { SaveS2 = true; } 72 void setSaveS2() { SaveS2 = true; }
80 bool hasSaveS2() const { return SaveS2; } 73 bool hasSaveS2() const { return SaveS2; }
81 74
82 int getMoveF64ViaSpillFI(const TargetRegisterClass *RC); 75 int getMoveF64ViaSpillFI(const TargetRegisterClass *RC);
83 76
84 std::map<const char *, const llvm::Mips16HardFloatInfo::FuncSignature *> 77 std::map<const char *, const Mips16HardFloatInfo::FuncSignature *>
85 StubsNeeded; 78 StubsNeeded;
86 79
87 private: 80 private:
88 virtual void anchor(); 81 virtual void anchor();
89 82
90 MachineFunction& MF; 83 MachineFunction& MF;
84
91 /// SRetReturnReg - Some subtargets require that sret lowering includes 85 /// SRetReturnReg - Some subtargets require that sret lowering includes
92 /// returning the value of the returned struct in a register. This field 86 /// returning the value of the returned struct in a register. This field
93 /// holds the virtual register into which the sret argument is passed. 87 /// holds the virtual register into which the sret argument is passed.
94 unsigned SRetReturnReg; 88 unsigned SRetReturnReg = 0;
95 89
96 /// GlobalBaseReg - keeps track of the virtual register initialized for 90 /// GlobalBaseReg - keeps track of the virtual register initialized for
97 /// use as the global base register. This is used for PIC in some PIC 91 /// use as the global base register. This is used for PIC in some PIC
98 /// relocation models. 92 /// relocation models.
99 unsigned GlobalBaseReg; 93 unsigned GlobalBaseReg = 0;
100 94
101 /// VarArgsFrameIndex - FrameIndex for start of varargs area. 95 /// VarArgsFrameIndex - FrameIndex for start of varargs area.
102 int VarArgsFrameIndex; 96 int VarArgsFrameIndex = 0;
103 97
104 /// True if function has a byval argument. 98 /// True if function has a byval argument.
105 bool HasByvalArg; 99 bool HasByvalArg;
106 100
107 /// Size of incoming argument area. 101 /// Size of incoming argument area.
108 unsigned IncomingArgSize; 102 unsigned IncomingArgSize;
109 103
110 /// CallsEhReturn - Whether the function calls llvm.eh.return. 104 /// CallsEhReturn - Whether the function calls llvm.eh.return.
111 bool CallsEhReturn; 105 bool CallsEhReturn = false;
112 106
113 /// Frame objects for spilling eh data registers. 107 /// Frame objects for spilling eh data registers.
114 int EhDataRegFI[4]; 108 int EhDataRegFI[4];
115 109
116 /// ISR - Whether the function is an Interrupt Service Routine. 110 /// ISR - Whether the function is an Interrupt Service Routine.
117 bool IsISR; 111 bool IsISR = false;
118 112
119 /// Frame objects for spilling C0_STATUS, C0_EPC 113 /// Frame objects for spilling C0_STATUS, C0_EPC
120 int ISRDataRegFI[2]; 114 int ISRDataRegFI[2];
121 115
122 // saveS2 116 // saveS2
123 bool SaveS2; 117 bool SaveS2 = false;
124 118
125 /// FrameIndex for expanding BuildPairF64 nodes to spill and reload when the 119 /// FrameIndex for expanding BuildPairF64 nodes to spill and reload when the
126 /// O32 FPXX ABI is enabled. -1 is used to denote invalid index. 120 /// O32 FPXX ABI is enabled. -1 is used to denote invalid index.
127 int MoveF64ViaSpillFI; 121 int MoveF64ViaSpillFI = -1;
128 }; 122 };
129 123
130 } // end of namespace llvm 124 } // end namespace llvm
131 125
132 #endif 126 #endif // LLVM_LIB_TARGET_MIPS_MIPSMACHINEFUNCTION_H