LLVM: include/llvm/CodeGen/MachineModuleInfo.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30#ifndef LLVM_CODEGEN_MACHINEMODULEINFO_H
31#define LLVM_CODEGEN_MACHINEMODULEINFO_H
32
39#include
40#include
41#include
42
43namespace llvm {
44
46class TargetMachine;
47class MachineFunction;
49
50
51
52
53
54
55
57public:
59 using SymbolListTy = std::vector<std::pair<MCSymbol *, StubValueTy>>;
60
61
62 using ExprStubListTy = std::vector<std::pair<MCSymbol *, const MCExpr *>>;
63
65
66protected:
67
68
70
71
72
75};
76
77
78
79
80
81
85
87
88
90
91
92 MCContext *ExternalContext = nullptr;
93
94
95 const Module *TheModule = nullptr;
96
97
98
99
101
102
104
105 unsigned NextFnNum = 0;
106 const Function *LastRequest = nullptr;
107 MachineFunction *LastResult = nullptr;
108
110
111public:
113
115
117
119
122
124
126 return ExternalContext ? *ExternalContext : Context;
127 }
129 return ExternalContext ? *ExternalContext : Context;
130 }
131
133
134
135
136
137
139
140
141
142
143
145
146
147
149
150
152
153
154
155 template
157 if (ObjFileMMI == nullptr)
158 ObjFileMMI = new Ty(*this);
159 return *static_cast<Ty*>(ObjFileMMI);
160 }
161
162 template
164 return const_cast<MachineModuleInfo*>(this)->getObjFileInfo();
165 }
166
167
168};
169
172
173public:
176
179
180
183
186};
187
188
189
190
191
192
196
198
199public:
204
205 public:
207
208
211 return false;
212 }
213 };
214
216
217
219};
220
221}
222
223#endif
This file defines the DenseMap class.
This header defines various interfaces for pass management in LLVM.
Machine Check Debug Module
This file defines the PointerIntPair class.
API to communicate dependencies between analyses during invalidation.
A container for analyses that lazily runs them and caches their results.
ImmutablePass class - This class is used to provide information that does not need to be run.
Context object for machine code objects.
bool invalidate(Module &, const PreservedAnalyses &, ModuleAnalysisManager::Invalidator &)
MachineModuleInfo & getMMI()
An analysis that produces MachineModuleInfo for a module.
Result run(Module &M, ModuleAnalysisManager &)
Run the analysis pass and produce machine module information.
MachineModuleAnalysis(MachineModuleInfo &MMI)
This class can be derived from and used by targets to hold private target-specific information for ea...
std::vector< std::pair< MCSymbol *, StubValueTy > > SymbolListTy
static SymbolListTy getSortedStubs(DenseMap< MCSymbol *, StubValueTy > &)
Return the entries from a DenseMap in a deterministic sorted orer.
std::vector< std::pair< MCSymbol *, const MCExpr * > > ExprStubListTy
A variant of SymbolListTy where the stub is a generalized MCExpr.
static ExprStubListTy getSortedExprStubs(DenseMap< MCSymbol *, const MCExpr * > &)
Return the entries from a DenseMap in a deterministic sorted orer.
virtual ~MachineModuleInfoImpl()
const MachineModuleInfo & getMMI() const
bool doFinalization(Module &) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
MachineModuleInfo & getMMI()
bool doInitialization(Module &) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
This class contains meta information specific to a module.
void insertFunction(const Function &F, std::unique_ptr< MachineFunction > &&MF)
Add an externally created MachineFunction MF for F.
const Ty & getObjFileInfo() const
const MCContext & getContext() const
const Module * getModule() const
MachineFunction & getOrCreateMachineFunction(Function &F)
Returns the MachineFunction constructed for the IR function F.
Ty & getObjFileInfo()
Keep track of various per-module pieces of information for backends that would like to do so.
const TargetMachine & getTarget() const
MachineFunction * getMachineFunction(const Function &F) const
Returns the MachineFunction associated to IR function F if there is one, otherwise nullptr.
void deleteMachineFunctionFor(Function &F)
Delete the MachineFunction MF and reset the link in the IR Function to Machine Function map.
A Module instance is used to store all the information related to an LLVM module.
PointerIntPair - This class implements a pair of a pointer and small integer.
A set of analyses that are preserved following a run of a transformation pass.
Primary interface to the complete machine description for the target machine.
This is an optimization pass for GlobalISel generic memory operations.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...