LLVM: include/llvm/CodeGen/GCMetadata.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

31

32#ifndef LLVM_CODEGEN_GCMETADATA_H

33#define LLVM_CODEGEN_GCMETADATA_H

34

45#include

46#include

47#include

48#include

49#include

50

51namespace llvm {

52

56

57

58

66

67

68

77

78

79

81public:

82 using iterator = std::vector::iterator;

84 using live_iterator = std::vector::const_iterator;

85

86private:

90 std::vector Roots;

91 std::vector SafePoints;

92

93

94

95

96

97

98

99

100

101

102

103public:

106

107

109 FunctionAnalysisManager::Invalidator &Inv);

110

111

113

114

116

117

118

119

123

124

126 return Roots.erase(position);

127 }

128

129

130

131

133 SafePoints.emplace_back(Label, DL);

134 }

135

136

139

140

143 size_t size() const { return SafePoints.size(); }

144

145

148 size_t roots_size() const { return Roots.size(); }

149

150

154};

155

157 using MapT =

159 MapT Strategies;

160

161public:

164

165

167 ModuleAnalysisManager::Invalidator &Inv);

168

173

178

183

184 bool empty() const { return Strategies.empty(); }

185

187 auto I = Strategies.find(GCName);

188 assert(I != Strategies.end() && "Required strategy doesn't exist!");

189 return *I->second;

190 }

191

193 return Strategies.try_emplace(GCName);

194 }

195

197};

198

199

200

210

211

212

213

222

223

224

225

226

227

228

233

234

235

236

238

240

242

243public:

244

245

246

248

249

250

251 using FuncInfoVec = std::vector<std::unique_ptr>;

252

253 FuncInfoVec::iterator funcinfo_begin() { return Functions.begin(); }

254 FuncInfoVec::iterator funcinfo_end() { return Functions.end(); }

255

256private:

257

259

260

261

263 finfo_map_type FInfoMap;

264

265public:

267

269

271

272

273

274

276

277

278

280 iterator end() const { return GCStrategyList.end(); }

281

282

283

284

286};

287

288}

289

290#endif

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

This file defines the StringMap class.

MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL

This file defines the DenseMap class.

This header defines various interfaces for pass management in LLVM.

This file implements a map that provides insertion order iteration.

FunctionAnalysisManager FAM

ModuleAnalysisManager MAM

This file defines the SmallVector class.

This is an important base class in LLVM.

An analysis pass which caches information about the Function.

Definition GCMetadata.h:214

GCFunctionInfo Result

Definition GCMetadata.h:219

LLVM_ABI Result run(Function &F, FunctionAnalysisManager &FAM)

Garbage collection metadata for a single function.

Definition GCMetadata.h:80

void setFrameSize(uint64_t S)

Definition GCMetadata.h:138

size_t roots_size() const

Definition GCMetadata.h:148

void addStackRoot(int Num, const Constant *Metadata)

addStackRoot - Registers a root that lives on the stack.

Definition GCMetadata.h:120

LLVM_ABI ~GCFunctionInfo()

void addSafePoint(MCSymbol *Label, const DebugLoc &DL)

addSafePoint - Notes the existence of a safe point.

Definition GCMetadata.h:132

std::vector< GCRoot >::iterator roots_iterator

Definition GCMetadata.h:83

LLVM_ABI bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)

Handle invalidation explicitly.

size_t live_size(const iterator &p) const

Definition GCMetadata.h:153

uint64_t getFrameSize() const

getFrameSize/setFrameSize - Records the function's frame size.

Definition GCMetadata.h:137

size_t size() const

Definition GCMetadata.h:143

iterator begin()

begin/end - Iterators for safe points.

Definition GCMetadata.h:141

live_iterator live_begin(const iterator &p)

live_begin/live_end - Iterators for live roots at a given safe point.

Definition GCMetadata.h:151

LLVM_ABI GCFunctionInfo(const Function &F, GCStrategy &S)

roots_iterator removeStackRoot(roots_iterator position)

removeStackRoot - Removes a root.

Definition GCMetadata.h:125

GCStrategy & getStrategy()

getStrategy - Return the GC strategy for the function.

Definition GCMetadata.h:115

live_iterator live_end(const iterator &p)

Definition GCMetadata.h:152

std::vector< GCRoot >::const_iterator live_iterator

Definition GCMetadata.h:84

roots_iterator roots_end()

Definition GCMetadata.h:147

std::vector< GCPoint >::iterator iterator

Definition GCMetadata.h:82

const Function & getFunction() const

getFunction - Return the function to which this metadata applies.

Definition GCMetadata.h:112

roots_iterator roots_begin()

roots_begin/roots_end - Iterators for all roots in the function.

Definition GCMetadata.h:146

iterator end()

Definition GCMetadata.h:142

LowerIntrinsics - This pass rewrites calls to the llvm.gcread or llvm.gcwrite intrinsics,...

Definition GCMetadata.h:229

LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)

std::vector< std::unique_ptr< GCFunctionInfo > > FuncInfoVec

List of per function info objects.

Definition GCMetadata.h:251

FuncInfoVec::iterator funcinfo_end()

Definition GCMetadata.h:254

FuncInfoVec::iterator funcinfo_begin()

Definition GCMetadata.h:253

LLVM_ABI GCFunctionInfo & getFunctionInfo(const Function &F)

get - Look up function metadata.

SmallVector< std::unique_ptr< GCStrategy >, 1 >::const_iterator iterator

Definition GCMetadata.h:266

iterator begin() const

begin/end - Iterators for used strategies.

Definition GCMetadata.h:279

iterator end() const

Definition GCMetadata.h:280

static LLVM_ABI char ID

Definition GCMetadata.h:268

LLVM_ABI void clear()

clear - Resets the pass.

LLVM_ABI GCStrategy * getGCStrategy(const StringRef Name)

Lookup the GCStrategy object associated with the given gc name.

Definition GCMetadata.h:156

std::pair< iterator, bool > try_emplace(StringRef GCName)

Definition GCMetadata.h:192

iterator end()

Definition GCMetadata.h:176

reverse_iterator rbegin()

Definition GCMetadata.h:179

GCStrategyMap(GCStrategyMap &&)=default

MapT::const_reverse_iterator const_reverse_iterator

Definition GCMetadata.h:172

const_reverse_iterator rend() const

Definition GCMetadata.h:182

const_iterator begin() const

Definition GCMetadata.h:175

MapT::const_iterator const_iterator

Definition GCMetadata.h:170

MapT::reverse_iterator reverse_iterator

Definition GCMetadata.h:171

MapT::iterator iterator

Definition GCMetadata.h:169

bool empty() const

Definition GCMetadata.h:184

LLVM_ABI bool invalidate(Module &M, const PreservedAnalyses &PA, ModuleAnalysisManager::Invalidator &Inv)

Handle invalidation explicitly.

bool contains(StringRef GCName) const

Definition GCMetadata.h:196

iterator begin()

Definition GCMetadata.h:174

const GCStrategy & operator[](StringRef GCName) const

Definition GCMetadata.h:186

reverse_iterator rend()

Definition GCMetadata.h:181

const_reverse_iterator rbegin() const

Definition GCMetadata.h:180

const_iterator end() const

Definition GCMetadata.h:177

GCStrategy describes a garbage collector algorithm's code generation requirements,...

MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...

This class implements a map that also provides access to all stored values in a deterministic order.

typename SmallVector< std::pair< StringRef, std::unique_ptr< GCStrategy > >, 0 >::iterator iterator

typename SmallVector< std::pair< StringRef, std::unique_ptr< GCStrategy > >, 0 >::const_reverse_iterator const_reverse_iterator

bool contains(const KeyT &Key) const

typename SmallVector< std::pair< StringRef, std::unique_ptr< GCStrategy > >, 0 >::reverse_iterator reverse_iterator

typename SmallVector< std::pair< StringRef, std::unique_ptr< GCStrategy > >, 0 >::const_iterator const_iterator

A Module instance is used to store all the information related to an LLVM module.

A set of analyses that are preserved following a run of a transformation pass.

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...

StringRef - Represent a constant reference to a string, i.e.

This is an optimization pass for GlobalISel generic memory operations.

OutputIt move(R &&Range, OutputIt Out)

Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.

AnalysisManager< Function > FunctionAnalysisManager

Convenience typedef for the Function analysis manager.

AnalysisManager< Module > ModuleAnalysisManager

Convenience typedef for the Module analysis manager.

Implement std::hash so that hash_code can be used in STL containers.

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

GCPoint(MCSymbol *L, DebugLoc DL)

Definition GCMetadata.h:63

MCSymbol * Label

A label.

Definition GCMetadata.h:60

DebugLoc Loc

Definition GCMetadata.h:61

GCRoot - Metadata for a pointer to an object managed by the garbage collector.

Definition GCMetadata.h:69

GCRoot(int N, const Constant *MD)

Definition GCMetadata.h:75

const Constant * Metadata

Metadata straight from the call to llvm.gcroot.

Definition GCMetadata.h:72

int StackOffset

Offset from the stack pointer.

Definition GCMetadata.h:71

int Num

Usually a frame index.

Definition GCMetadata.h:70

A CRTP mix-in to automatically provide informational APIs needed for passes.