LLVM: include/llvm/IR/LLVMContext.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_IR_LLVMCONTEXT_H

15#define LLVM_IR_LLVMCONTEXT_H

16

21#include

22#include

23#include

24#include

25

26namespace llvm {

27

40

43}

44

46

48

49

50

51

52

53enum {

54

56

57

59};

60

61}

62

63

64

65

66

67

69public:

75

76

77

78 enum : unsigned {

79#define LLVM_FIXED_MD_KIND(EnumID, Name, Value) EnumID = Value,

80#include "llvm/IR/FixedMetadataKinds.def"

81#undef LLVM_FIXED_MD_KIND

82 };

83

84

85

86

87

88

89 enum : unsigned {

103 };

104

105

106

108

109

110

112

113

114

115

116

118

119

120

123

124

125

127

128

129

130

132

133

134

135

137

138

139

141

142

144

145

147

148

150

151

152

153

155

156

157

158

160

161

162

166

167

168

170

171

172

174

175

176

177

178

179

180

181

182

185 void *DiagContext = nullptr, bool RespectFilters = false);

186

187

188

189

190

191

192

193

195 bool RespectFilters = false);

196

197

198

201

202

203

205

206

207

209

210

211

213

214

215

217

218

220

226

227

228

229

230

231

232

233

234

235

236

238

239

240

243

244

246

247

248

249

250

251

252

253

257 std::unique_ptrremarks::RemarkStreamer MainRemarkStreamer);

258

259

260

261

262

263

268

269

270

273

274

275

276

277

278

279

280

281

282

283

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

304

305

306

307

308

309

311

312

313

314

315

316

319

320

321

323

324

325

326

327

328

330

331

332

333

334

335

336

337

338

339

342

343

346

347

348

350

351

352

354

355private:

356

358

359

360

361 void addModule(Module*);

362

363

364 void removeModule(Module *);

365};

366

367

369

370

371

375

379

380

382

383}

384

385#endif

#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)

static void DiagHandler(const SMDiagnostic &Diag, void *Context)

This is the base abstract class for diagnostic reporting in the backend.

This is an important class for using LLVM in a threaded context.

Definition LLVMContext.h:68

LLVM_ABI uint64_t incNextDILocationAtomGroup()

Key Instructions: get the next free atom group number and increment the global tracker.

LLVM_ABI void setMisExpectWarningRequested(bool Requested)

LLVM_ABI std::optional< StringRef > getSyncScopeName(SyncScope::ID Id) const

getSyncScopeName - Returns the name of a SyncScope::ID registered with LLVMContext,...

LLVM_ABI remarks::RemarkStreamer * getMainRemarkStreamer()

The "main remark streamer" used by all the specialized remark streamers.

LLVM_ABI uint32_t getOperandBundleTagID(StringRef Tag) const

getOperandBundleTagID - Maps a bundle tag to an integer ID.

friend class Module

Definition LLVMContext.h:357

LLVM_ABI void disableDebugTypeODRUniquing()

LLVM_ABI void setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle)

Registers a yield callback with the given context.

LLVM_ABI void deleteGC(const Function &Fn)

Remove the GC for a function.

LLVM_ABI const std::string & getGC(const Function &Fn)

Return the GC for a function.

LLVM_ABI DiagnosticHandler::DiagnosticHandlerTy getDiagnosticHandlerCallBack() const

getDiagnosticHandlerCallBack - Return the diagnostic handler call back set by setDiagnosticHandlerCal...

LLVM_ABI void setLLVMRemarkStreamer(std::unique_ptr< LLVMRemarkStreamer > RemarkStreamer)

LLVM_ABI unsigned getMDKindID(StringRef Name) const

getMDKindID - Return a unique non-zero ID for the specified metadata kind.

LLVM_ABI void emitError(const Instruction *I, const Twine &ErrorStr)

emitError - Emit an error message to the currently installed error handler with optional location inf...

@ OB_preallocated

Definition LLVMContext.h:94

@ OB_LastBundleID

Definition LLVMContext.h:102

@ OB_gc_transition

Definition LLVMContext.h:92

@ OB_deopt

Definition LLVMContext.h:90

@ OB_align

Definition LLVMContext.h:100

@ OB_clang_arc_attachedcall

Definition LLVMContext.h:96

@ OB_cfguardtarget

Definition LLVMContext.h:93

@ OB_funclet

Definition LLVMContext.h:91

@ OB_deactivation_symbol

Definition LLVMContext.h:101

@ OB_convergencectrl

Definition LLVMContext.h:99

@ OB_kcfi

Definition LLVMContext.h:98

@ OB_ptrauth

Definition LLVMContext.h:97

@ OB_gc_live

Definition LLVMContext.h:95

static LLVM_ABI const char * getDiagnosticMessagePrefix(DiagnosticSeverity Severity)

Get the prefix that should be printed in front of a diagnostic of the given Severity.

LLVM_ABI void enableDebugTypeODRUniquing()

LLVM_ABI std::unique_ptr< DiagnosticHandler > getDiagnosticHandler()

getDiagnosticHandler - transfers ownership of DiagnosticHandler unique_ptr to caller.

LLVM_ABI void setDefaultTargetCPU(StringRef CPU)

LLVM_ABI bool getDiagnosticsHotnessRequested() const

Return if a code hotness metric should be included in optimization diagnostics.

LLVM_ABI bool getMisExpectWarningRequested() const

LLVM_ABI void yield()

Calls the yield callback (if applicable).

LLVM_ABI void setDiagnosticsHotnessThreshold(std::optional< uint64_t > Threshold)

Set the minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.

LLVM_ABI void setMainRemarkStreamer(std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer)

LLVM_ABI bool isDiagnosticsHotnessThresholdSetFromPSI() const

Return if hotness threshold is requested from PSI.

LLVM_ABI void setOptPassGate(OptPassGate &)

Set the object which can disable optional passes and individual optimizations at compile time.

LLVM_ABI StringMapEntry< uint32_t > * getOrInsertBundleTag(StringRef TagName) const

getOrInsertBundleTag - Returns the Tag to use for an operand bundle of name TagName.

LLVMContext & operator=(const LLVMContext &)=delete

LLVM_ABI void setDiagnosticsHotnessRequested(bool Requested)

Set if a code hotness metric should be included in optimization diagnostics.

LLVM_ABI void setGC(const Function &Fn, std::string GCName)

Define the GC for a function.

LLVM_ABI bool shouldDiscardValueNames() const

Return true if the Context runtime configuration is set to discard all value names.

void(*)(LLVMContext *Context, void *OpaqueHandle) YieldCallbackTy

Defines the type of a yield callback.

Definition LLVMContext.h:173

LLVM_ABI bool isODRUniquingDebugTypes() const

Whether there is a string map for uniquing debug info identifiers across the context.

LLVM_ABI unsigned generateMachineFunctionNum(Function &)

generateMachineFunctionNum - Get a unique number for MachineFunction that associated with the given F...

LLVM_ABI StringRef getDefaultTargetFeatures()

Similar to {get,set}DefaultTargetCPU() but for default target-features.

LLVM_ABI void setDiagnosticsMisExpectTolerance(std::optional< uint32_t > Tolerance)

LLVMContextImpl *const pImpl

Definition LLVMContext.h:70

LLVMContext(const LLVMContext &)=delete

LLVM_ABI void diagnose(const DiagnosticInfo &DI)

Report a message to the currently installed diagnostic handler.

LLVM_ABI void getOperandBundleTags(SmallVectorImpl< StringRef > &Result) const

getOperandBundleTags - Populate client supplied SmallVector with the bundle tags registered in this L...

LLVM_ABI void setDiagnosticHandlerCallBack(DiagnosticHandler::DiagnosticHandlerTy DiagHandler, void *DiagContext=nullptr, bool RespectFilters=false)

setDiagnosticHandlerCallBack - This method sets a handler call back that is invoked when the backend ...

LLVM_ABI void setDiscardValueNames(bool Discard)

Set the Context runtime configuration to discard all value name (but GlobalValue).

LLVM_ABI StringRef getDefaultTargetCPU()

Get or set the current "default" target CPU (target-cpu function attribute).

LLVM_ABI void getMDKindNames(SmallVectorImpl< StringRef > &Result) const

getMDKindNames - Populate client supplied SmallVector with the name for custom metadata IDs registere...

LLVM_ABI void * getDiagnosticContext() const

getDiagnosticContext - Return the diagnostic context set by setDiagnosticContext.

LLVM_ABI void updateDILocationAtomGroupWaterline(uint64_t G)

Key Instructions: update the highest number atom group emitted for any function.

LLVM_ABI SyncScope::ID getOrInsertSyncScopeID(StringRef SSN)

getOrInsertSyncScopeID - Maps synchronization scope name to synchronization scope ID.

LLVM_ABI uint64_t getDiagnosticsHotnessThreshold() const

Return the minimum hotness value a diagnostic would need in order to be included in optimization diag...

LLVM_ABI void setDefaultTargetFeatures(StringRef Features)

LLVM_ABI const DiagnosticHandler * getDiagHandlerPtr() const

getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler.

LLVM_ABI void setDiagnosticHandler(std::unique_ptr< DiagnosticHandler > &&DH, bool RespectFilters=false)

setDiagnosticHandler - This method sets unique_ptr to object of DiagnosticHandler to provide custom d...

LLVM_ABI OptPassGate & getOptPassGate() const

Access the object which can disable optional passes and individual optimizations at compile time.

LLVM_ABI LLVMRemarkStreamer * getLLVMRemarkStreamer()

The "LLVM remark streamer" used by LLVM to serialize remark diagnostics comming from IR and MIR passe...

LLVM_ABI void getSyncScopeNames(SmallVectorImpl< StringRef > &SSNs) const

getSyncScopeNames - Populates client supplied SmallVector with synchronization scope names registered...

LLVM_ABI uint32_t getDiagnosticsMisExpectTolerance() const

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

Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...

This class consists of common code factored out of the SmallVector class to reduce code duplication b...

StringMapEntry - This is used to represent one value that is inserted into a StringMap.

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

Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...

struct LLVMOpaqueContext * LLVMContextRef

The top-level container for all LLVM global data.

Definition LLVMContext.h:45

@ SingleThread

Synchronized with respect to signal handlers executing in the same thread.

Definition LLVMContext.h:55

@ System

Synchronized with respect to all concurrently executing threads.

Definition LLVMContext.h:58

uint8_t ID

Definition LLVMContext.h:47

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI LLVMContextRef getGlobalContextForCAPI()

Get the deprecated global context for use by the C API.

Attribute unwrap(LLVMAttributeRef Attr)

DiagnosticSeverity

Defines the different supported severity of a diagnostic.

LLVMAttributeRef wrap(Attribute Attr)

This is the base class for diagnostic handling in LLVM.

void(*)(const DiagnosticInfo *DI, void *Context) DiagnosticHandlerTy