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

40#include

41#include

42#include

43

44namespace llvm {

45

50

51

52

53

54

55

56

58public:

60 using SymbolListTy = std::vector<std::pair<MCSymbol *, StubValueTy>>;

61

62

63 using ExprStubListTy = std::vector<std::pair<MCSymbol *, const MCExpr *>>;

64

66

67protected:

68

69

71

72

73

76};

77

78

79

80

81

82

86

88

89

91

92

93 MCContext *ExternalContext = nullptr;

94

95

96 const Module *TheModule = nullptr;

97

98

99

100

102

103

105

106 unsigned NextFnNum = 0;

107 const Function *LastRequest = nullptr;

108 MachineFunction *LastResult = nullptr;

109

111

112public:

114

117

119

121

124

126

128 return ExternalContext ? *ExternalContext : Context;

129 }

131 return ExternalContext ? *ExternalContext : Context;

132 }

133

135

136

137

138

139

141

142

143

144

145

147

148

149

151

152

154 std::unique_ptr &&MF);

155

156

157

158 template

160 if (ObjFileMMI == nullptr)

161 ObjFileMMI = new Ty(*this);

162 return *static_cast<Ty*>(ObjFileMMI);

163 }

164

165 template

169

170

171};

172

175

176public:

177 static char ID;

179

182

183

186

189};

190

191

192

193

194

195

199

201

202public:

203 class Result {

207

208 public:

210

211

213 ModuleAnalysisManager::Invalidator &) {

214 return false;

215 }

216 };

217

219

220

222};

223

224}

225

226#endif

This file defines the DenseMap class.

This header defines various interfaces for pass management in LLVM.

This file defines the PointerIntPair class.

Context object for machine code objects.

friend class MachineModuleAnalysis

Definition MachineModuleInfo.h:206

bool invalidate(Module &, const PreservedAnalyses &, ModuleAnalysisManager::Invalidator &)

Definition MachineModuleInfo.h:212

MachineModuleInfo & getMMI()

Definition MachineModuleInfo.h:209

LLVM_ABI Result run(Module &M, ModuleAnalysisManager &)

Run the analysis pass and produce machine module information.

MachineModuleAnalysis(MachineModuleInfo &MMI)

Definition MachineModuleInfo.h:218

This class can be derived from and used by targets to hold private target-specific information for ea...

Definition MachineModuleInfo.h:57

std::vector< std::pair< MCSymbol *, StubValueTy > > SymbolListTy

Definition MachineModuleInfo.h:60

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.

Definition MachineModuleInfo.h:63

PointerIntPair< MCSymbol *, 1, bool > StubValueTy

Definition MachineModuleInfo.h:59

static ExprStubListTy getSortedExprStubs(DenseMap< MCSymbol *, const MCExpr * > &)

Return the entries from a DenseMap in a deterministic sorted orer.

virtual ~MachineModuleInfoImpl()

const MachineModuleInfo & getMMI() const

Definition MachineModuleInfo.h:188

bool doFinalization(Module &) override

doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...

MachineModuleInfoWrapperPass(const TargetMachine *TM=nullptr)

MachineModuleInfo & getMMI()

Definition MachineModuleInfo.h:187

static char ID

Definition MachineModuleInfo.h:177

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.

Definition MachineModuleInfo.h:83

LLVM_ABI MachineModuleInfo(const TargetMachine *TM=nullptr)

LLVM_ABI void initialize()

LLVM_ABI void insertFunction(const Function &F, std::unique_ptr< MachineFunction > &&MF)

Add an externally created MachineFunction MF for F.

friend class MachineModuleAnalysis

Definition MachineModuleInfo.h:85

const Ty & getObjFileInfo() const

Definition MachineModuleInfo.h:166

const MCContext & getContext() const

Definition MachineModuleInfo.h:127

const Module * getModule() const

Definition MachineModuleInfo.h:134

friend class MachineModuleInfoWrapperPass

Definition MachineModuleInfo.h:84

LLVM_ABI MachineFunction & getOrCreateMachineFunction(Function &F)

Returns the MachineFunction constructed for the IR function F.

MCContext & getContext()

Definition MachineModuleInfo.h:130

LLVM_ABI ~MachineModuleInfo()

Ty & getObjFileInfo()

Keep track of various per-module pieces of information for backends that would like to do so.

Definition MachineModuleInfo.h:159

const TargetMachine & getTarget() const

Definition MachineModuleInfo.h:125

LLVM_ABI MachineFunction * getMachineFunction(const Function &F) const

Returns the MachineFunction associated to IR function F if there is one, otherwise nullptr.

LLVM_ABI 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.

AnalysisManager< Module > ModuleAnalysisManager

Convenience typedef for the Module analysis manager.

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...