Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
LLVMContext.h
Go to the documentation of this file.
1//===- llvm/LLVMContext.h - Class for managing "global" state ---*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares LLVMContext, a container of "global" state in LLVM, such
10// as the global type and constant uniquing tables.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_IR_LLVMCONTEXT_H
15#define LLVM_IR_LLVMCONTEXT_H
16
17#include "llvm-c/Types.h"
18#include "llvm/IR/DiagnosticHandler.h"
19#include "llvm/Support/CBindingWrapping.h"
20#include <cstdint>
21#include <memory>
22#include <optional>
23#include <string>
24
25namespacellvm {
26
27classDiagnosticInfo;
28enumDiagnosticSeverity :char;
29classFunction;
30classInstruction;
31classLLVMContextImpl;
32classModule;
33classOptPassGate;
34template <typename T>classSmallVectorImpl;
35template <typename T>classStringMapEntry;
36classStringRef;
37classTwine;
38classLLVMRemarkStreamer;
39
40namespaceremarks {
41classRemarkStreamer;
42}
43
44namespaceSyncScope {
45
46typedefuint8_tID;
47
48/// Known synchronization scope IDs, which always have the same value. All
49/// synchronization scope IDs that LLVM has special knowledge of are listed
50/// here. Additionally, this scheme allows LLVM to efficiently check for
51/// specific synchronization scope ID without comparing strings.
52enum {
53 /// Synchronized with respect to signal handlers executing in the same thread.
54SingleThread = 0,
55
56 /// Synchronized with respect to all concurrently executing threads.
57System = 1
58};
59
60}// end namespace SyncScope
61
62/// This is an important class for using LLVM in a threaded context. It
63/// (opaquely) owns and manages the core "global" data of LLVM's core
64/// infrastructure, including the type and constant uniquing tables.
65/// LLVMContext itself provides no locking guarantees, so you should be careful
66/// to have one context per thread.
67classLLVMContext {
68public:
69LLVMContextImpl *constpImpl;
70LLVMContext();
71LLVMContext(constLLVMContext &) =delete;
72LLVMContext &operator=(constLLVMContext &) =delete;
73~LLVMContext();
74
75// Pinned metadata names, which always have the same value. This is a
76// compile-time performance optimization, not a correctness optimization.
77 enum :unsigned {
78#define LLVM_FIXED_MD_KIND(EnumID, Name, Value) EnumID = Value,
79#include "llvm/IR/FixedMetadataKinds.def"
80#undef LLVM_FIXED_MD_KIND
81 };
82
83 /// Known operand bundle tag IDs, which always have the same value. All
84 /// operand bundle tags that LLVM has special knowledge of are listed here.
85 /// Additionally, this scheme allows LLVM to efficiently check for specific
86 /// operand bundle tags without comparing strings. Keep this in sync with
87 /// LLVMContext::LLVMContext().
88 enum :unsigned {
89OB_deopt = 0,// "deopt"
90OB_funclet = 1,// "funclet"
91OB_gc_transition = 2,// "gc-transition"
92OB_cfguardtarget = 3,// "cfguardtarget"
93OB_preallocated = 4,// "preallocated"
94OB_gc_live = 5,// "gc-live"
95OB_clang_arc_attachedcall = 6,// "clang.arc.attachedcall"
96OB_ptrauth = 7,// "ptrauth"
97OB_kcfi = 8,// "kcfi"
98OB_convergencectrl = 9,// "convergencectrl"
99 };
100
101 /// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
102 /// This ID is uniqued across modules in the current LLVMContext.
103unsignedgetMDKindID(StringRefName)const;
104
105 /// getMDKindNames - Populate client supplied SmallVector with the name for
106 /// custom metadata IDs registered in this LLVMContext.
107voidgetMDKindNames(SmallVectorImpl<StringRef> &Result)const;
108
109 /// getOperandBundleTags - Populate client supplied SmallVector with the
110 /// bundle tags registered in this LLVMContext. The bundle tags are ordered
111 /// by increasing bundle IDs.
112 /// \see LLVMContext::getOperandBundleTagID
113voidgetOperandBundleTags(SmallVectorImpl<StringRef> &Result)const;
114
115 /// getOrInsertBundleTag - Returns the Tag to use for an operand bundle of
116 /// name TagName.
117StringMapEntry<uint32_t> *getOrInsertBundleTag(StringRef TagName)const;
118
119 /// getOperandBundleTagID - Maps a bundle tag to an integer ID. Every bundle
120 /// tag registered with an LLVMContext has an unique ID.
121uint32_tgetOperandBundleTagID(StringRefTag)const;
122
123 /// getOrInsertSyncScopeID - Maps synchronization scope name to
124 /// synchronization scope ID. Every synchronization scope registered with
125 /// LLVMContext has unique ID except pre-defined ones.
126SyncScope::IDgetOrInsertSyncScopeID(StringRef SSN);
127
128 /// getSyncScopeNames - Populates client supplied SmallVector with
129 /// synchronization scope names registered with LLVMContext. Synchronization
130 /// scope names are ordered by increasing synchronization scope IDs.
131voidgetSyncScopeNames(SmallVectorImpl<StringRef> &SSNs)const;
132
133 /// getSyncScopeName - Returns the name of a SyncScope::ID
134 /// registered with LLVMContext, if any.
135 std::optional<StringRef>getSyncScopeName(SyncScope::ID Id)const;
136
137 /// Define the GC for a function
138voidsetGC(constFunction &Fn, std::string GCName);
139
140 /// Return the GC for a function
141const std::string &getGC(constFunction &Fn);
142
143 /// Remove the GC for a function
144voiddeleteGC(constFunction &Fn);
145
146 /// Return true if the Context runtime configuration is set to discard all
147 /// value names. When true, only GlobalValue names will be available in the
148 /// IR.
149boolshouldDiscardValueNames()const;
150
151 /// Set the Context runtime configuration to discard all value name (but
152 /// GlobalValue). Clients can use this flag to save memory and runtime,
153 /// especially in release mode.
154voidsetDiscardValueNames(bool Discard);
155
156 /// Whether there is a string map for uniquing debug info
157 /// identifiers across the context. Off by default.
158boolisODRUniquingDebugTypes()const;
159voidenableDebugTypeODRUniquing();
160voiddisableDebugTypeODRUniquing();
161
162 /// generateMachineFunctionNum - Get a unique number for MachineFunction
163 /// that associated with the given Function.
164unsignedgenerateMachineFunctionNum(Function &);
165
166 /// Defines the type of a yield callback.
167 /// \see LLVMContext::setYieldCallback.
168usingYieldCallbackTy = void (*)(LLVMContext *Context,void *OpaqueHandle);
169
170 /// setDiagnosticHandlerCallBack - This method sets a handler call back
171 /// that is invoked when the backend needs to report anything to the user.
172 /// The first argument is a function pointer and the second is a context pointer
173 /// that gets passed into the DiagHandler. The third argument should be set to
174 /// true if the handler only expects enabled diagnostics.
175 ///
176 /// LLVMContext doesn't take ownership or interpret either of these
177 /// pointers.
178voidsetDiagnosticHandlerCallBack(
179DiagnosticHandler::DiagnosticHandlerTyDiagHandler,
180void *DiagContext =nullptr,bool RespectFilters =false);
181
182 /// setDiagnosticHandler - This method sets unique_ptr to object of
183 /// DiagnosticHandler to provide custom diagnostic handling. The first
184 /// argument is unique_ptr of object of type DiagnosticHandler or a derived
185 /// of that. The second argument should be set to true if the handler only
186 /// expects enabled diagnostics.
187 ///
188 /// Ownership of this pointer is moved to LLVMContextImpl.
189voidsetDiagnosticHandler(std::unique_ptr<DiagnosticHandler> &&DH,
190bool RespectFilters =false);
191
192 /// getDiagnosticHandlerCallBack - Return the diagnostic handler call back set by
193 /// setDiagnosticHandlerCallBack.
194DiagnosticHandler::DiagnosticHandlerTygetDiagnosticHandlerCallBack()const;
195
196 /// getDiagnosticContext - Return the diagnostic context set by
197 /// setDiagnosticContext.
198void *getDiagnosticContext()const;
199
200 /// getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by
201 /// setDiagnosticHandler.
202constDiagnosticHandler *getDiagHandlerPtr()const;
203
204 /// getDiagnosticHandler - transfers ownership of DiagnosticHandler unique_ptr
205 /// to caller.
206 std::unique_ptr<DiagnosticHandler>getDiagnosticHandler();
207
208 /// Return if a code hotness metric should be included in optimization
209 /// diagnostics.
210boolgetDiagnosticsHotnessRequested()const;
211 /// Set if a code hotness metric should be included in optimization
212 /// diagnostics.
213voidsetDiagnosticsHotnessRequested(bool Requested);
214
215boolgetMisExpectWarningRequested()const;
216voidsetMisExpectWarningRequested(bool Requested);
217voidsetDiagnosticsMisExpectTolerance(std::optional<uint32_t> Tolerance);
218uint32_tgetDiagnosticsMisExpectTolerance()const;
219
220 /// Return the minimum hotness value a diagnostic would need in order
221 /// to be included in optimization diagnostics.
222 ///
223 /// Three possible return values:
224 /// 0 - threshold is disabled. Everything will be printed out.
225 /// positive int - threshold is set.
226 /// UINT64_MAX - threshold is not yet set, and needs to be synced from
227 /// profile summary. Note that in case of missing profile
228 /// summary, threshold will be kept at "MAX", effectively
229 /// suppresses all remarks output.
230uint64_tgetDiagnosticsHotnessThreshold()const;
231
232 /// Set the minimum hotness value a diagnostic needs in order to be
233 /// included in optimization diagnostics.
234voidsetDiagnosticsHotnessThreshold(std::optional<uint64_t> Threshold);
235
236 /// Return if hotness threshold is requested from PSI.
237boolisDiagnosticsHotnessThresholdSetFromPSI()const;
238
239 /// The "main remark streamer" used by all the specialized remark streamers.
240 /// This streamer keeps generic remark metadata in memory throughout the life
241 /// of the LLVMContext. This metadata may be emitted in a section in object
242 /// files depending on the format requirements.
243 ///
244 /// All specialized remark streamers should convert remarks to
245 /// llvm::remarks::Remark and emit them through this streamer.
246remarks::RemarkStreamer *getMainRemarkStreamer();
247constremarks::RemarkStreamer *getMainRemarkStreamer()const;
248voidsetMainRemarkStreamer(
249 std::unique_ptr<remarks::RemarkStreamer> MainRemarkStreamer);
250
251 /// The "LLVM remark streamer" used by LLVM to serialize remark diagnostics
252 /// comming from IR and MIR passes.
253 ///
254 /// If it does not exist, diagnostics are not saved in a file but only emitted
255 /// via the diagnostic handler.
256LLVMRemarkStreamer *getLLVMRemarkStreamer();
257constLLVMRemarkStreamer *getLLVMRemarkStreamer()const;
258void
259setLLVMRemarkStreamer(std::unique_ptr<LLVMRemarkStreamer> RemarkStreamer);
260
261 /// Get the prefix that should be printed in front of a diagnostic of
262 /// the given \p Severity
263staticconstchar *getDiagnosticMessagePrefix(DiagnosticSeverity Severity);
264
265 /// Report a message to the currently installed diagnostic handler.
266 ///
267 /// This function returns, in particular in the case of error reporting
268 /// (DI.Severity == \a DS_Error), so the caller should leave the compilation
269 /// process in a self-consistent state, even though the generated code
270 /// need not be correct.
271 ///
272 /// The diagnostic message will be implicitly prefixed with a severity keyword
273 /// according to \p DI.getSeverity(), i.e., "error: " for \a DS_Error,
274 /// "warning: " for \a DS_Warning, and "note: " for \a DS_Note.
275voiddiagnose(constDiagnosticInfo &DI);
276
277 /// Registers a yield callback with the given context.
278 ///
279 /// The yield callback function may be called by LLVM to transfer control back
280 /// to the client that invoked the LLVM compilation. This can be used to yield
281 /// control of the thread, or perform periodic work needed by the client.
282 /// There is no guaranteed frequency at which callbacks must occur; in fact,
283 /// the client is not guaranteed to ever receive this callback. It is at the
284 /// sole discretion of LLVM to do so and only if it can guarantee that
285 /// suspending the thread won't block any forward progress in other LLVM
286 /// contexts in the same process.
287 ///
288 /// At a suspend point, the state of the current LLVM context is intentionally
289 /// undefined. No assumptions about it can or should be made. Only LLVM
290 /// context API calls that explicitly state that they can be used during a
291 /// yield callback are allowed to be used. Any other API calls into the
292 /// context are not supported until the yield callback function returns
293 /// control to LLVM. Other LLVM contexts are unaffected by this restriction.
294voidsetYieldCallback(YieldCallbackTy Callback,void *OpaqueHandle);
295
296 /// Calls the yield callback (if applicable).
297 ///
298 /// This transfers control of the current thread back to the client, which may
299 /// suspend the current thread. Only call this method when LLVM doesn't hold
300 /// any global mutex or cannot block the execution in another LLVM context.
301voidyield();
302
303 /// emitError - Emit an error message to the currently installed error handler
304 /// with optional location information. This function returns, so code should
305 /// be prepared to drop the erroneous construct on the floor and "not crash".
306 /// The generated code need not be correct. The error message will be
307 /// implicitly prefixed with "error: " and should not end with a ".".
308voidemitError(constInstruction *I,constTwine &ErrorStr);
309voidemitError(constTwine &ErrorStr);
310
311 /// Access the object which can disable optional passes and individual
312 /// optimizations at compile time.
313OptPassGate &getOptPassGate()const;
314
315 /// Set the object which can disable optional passes and individual
316 /// optimizations at compile time.
317 ///
318 /// The lifetime of the object must be guaranteed to extend as long as the
319 /// LLVMContext is used by compilation.
320voidsetOptPassGate(OptPassGate&);
321
322 /// Get or set the current "default" target CPU (target-cpu function
323 /// attribute). The intent is that compiler frontends will set this to a value
324 /// that reflects the attribute that a function would get "by default" without
325 /// any specific function attributes, and compiler passes will attach the
326 /// attribute to newly created functions that are not associated with a
327 /// particular function, such as global initializers.
328 /// Function::createWithDefaultAttr() will create functions with this
329 /// attribute. This function should only be called by passes that run at
330 /// compile time and not by the backend or LTO passes.
331StringRefgetDefaultTargetCPU();
332voidsetDefaultTargetCPU(StringRef CPU);
333
334 /// Similar to {get,set}DefaultTargetCPU() but for default target-features.
335StringRefgetDefaultTargetFeatures();
336voidsetDefaultTargetFeatures(StringRef Features);
337
338private:
339// Module needs access to the add/removeModule methods.
340friendclassModule;
341
342 /// addModule - Register a module as being instantiated in this context. If
343 /// the context is deleted, the module will be deleted as well.
344void addModule(Module*);
345
346 /// removeModule - Unregister a module from this context.
347void removeModule(Module *);
348};
349
350// Create wrappers for C Binding types (see CBindingWrapping.h).
351DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LLVMContext,LLVMContextRef)
352
353/* Specialized opaque context conversions.
354 */
355inlineLLVMContext **unwrap(LLVMContextRef* Tys) {
356returnreinterpret_cast<LLVMContext**>(Tys);
357}
358
359inlineLLVMContextRef *wrap(constLLVMContext **Tys) {
360returnreinterpret_cast<LLVMContextRef*>(const_cast<LLVMContext**>(Tys));
361}
362
363}// end namespace llvm
364
365#endif// LLVM_IR_LLVMCONTEXT_H
inline
always inline
Definition:AlwaysInliner.cpp:161
CBindingWrapping.h
DEFINE_SIMPLE_CONVERSION_FUNCTIONS
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
Definition:CBindingWrapping.h:19
DiagnosticHandler.h
Name
std::string Name
Definition:ELFObjHandler.cpp:77
I
#define I(x, y, z)
Definition:MD5.cpp:58
Module
Machine Check Debug Module
Definition:MachineCheckDebugify.cpp:124
DiagHandler
static void DiagHandler(const SMDiagnostic &Diag, void *Context)
Definition:TextStub.cpp:1060
Types.h
char
llvm::DiagnosticInfo
This is the base abstract class for diagnostic reporting in the backend.
Definition:DiagnosticInfo.h:112
llvm::Function
Definition:Function.h:63
llvm::Instruction
Definition:Instruction.h:68
llvm::LLVMContextImpl
Definition:LLVMContextImpl.h:1469
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition:LLVMContext.h:67
llvm::LLVMContext::setMisExpectWarningRequested
void setMisExpectWarningRequested(bool Requested)
Definition:LLVMContext.cpp:143
llvm::LLVMContext::getSyncScopeName
std::optional< StringRef > getSyncScopeName(SyncScope::ID Id) const
getSyncScopeName - Returns the name of a SyncScope::ID registered with LLVMContext,...
Definition:LLVMContext.cpp:314
llvm::LLVMContext::getMainRemarkStreamer
remarks::RemarkStreamer * getMainRemarkStreamer()
The "main remark streamer" used by all the specialized remark streamers.
Definition:LLVMContext.cpp:164
llvm::LLVMContext::getOperandBundleTagID
uint32_t getOperandBundleTagID(StringRef Tag) const
getOperandBundleTagID - Maps a bundle tag to an integer ID.
Definition:LLVMContext.cpp:302
llvm::LLVMContext::disableDebugTypeODRUniquing
void disableDebugTypeODRUniquing()
Definition:LLVMContext.cpp:343
llvm::LLVMContext::setYieldCallback
void setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle)
Registers a yield callback with the given context.
Definition:LLVMContext.cpp:195
llvm::LLVMContext::deleteGC
void deleteGC(const Function &Fn)
Remove the GC for a function.
Definition:LLVMContext.cpp:326
llvm::LLVMContext::getGC
const std::string & getGC(const Function &Fn)
Return the GC for a function.
Definition:LLVMContext.cpp:322
llvm::LLVMContext::getDiagnosticHandlerCallBack
DiagnosticHandler::DiagnosticHandlerTy getDiagnosticHandlerCallBack() const
getDiagnosticHandlerCallBack - Return the diagnostic handler call back set by setDiagnosticHandlerCal...
Definition:LLVMContext.cpp:187
llvm::LLVMContext::setLLVMRemarkStreamer
void setLLVMRemarkStreamer(std::unique_ptr< LLVMRemarkStreamer > RemarkStreamer)
Definition:LLVMContext.cpp:181
llvm::LLVMContext::getMDKindID
unsigned getMDKindID(StringRef Name) const
getMDKindID - Return a unique non-zero ID for the specified metadata kind.
Definition:LLVMContext.cpp:276
llvm::LLVMContext::emitError
void emitError(const Instruction *I, const Twine &ErrorStr)
emitError - Emit an error message to the currently installed error handler with optional location inf...
Definition:LLVMContext.cpp:210
llvm::LLVMContext::getDiagnosticMessagePrefix
static const char * getDiagnosticMessagePrefix(DiagnosticSeverity Severity)
Get the prefix that should be printed in front of a diagnostic of the given Severity.
Definition:LLVMContext.cpp:231
llvm::LLVMContext::enableDebugTypeODRUniquing
void enableDebugTypeODRUniquing()
Definition:LLVMContext.cpp:336
llvm::LLVMContext::~LLVMContext
~LLVMContext()
Definition:LLVMContext.cpp:98
llvm::LLVMContext::getDiagnosticHandler
std::unique_ptr< DiagnosticHandler > getDiagnosticHandler()
getDiagnosticHandler - transfers ownership of DiagnosticHandler unique_ptr to caller.
Definition:LLVMContext.cpp:361
llvm::LLVMContext::setDefaultTargetCPU
void setDefaultTargetCPU(StringRef CPU)
Definition:LLVMContext.cpp:369
llvm::LLVMContext::LLVMContext
LLVMContext()
Definition:LLVMContext.cpp:63
llvm::LLVMContext::getDiagnosticsHotnessRequested
bool getDiagnosticsHotnessRequested() const
Return if a code hotness metric should be included in optimization diagnostics.
Definition:LLVMContext.cpp:136
llvm::LLVMContext::getMisExpectWarningRequested
bool getMisExpectWarningRequested() const
Definition:LLVMContext.cpp:146
llvm::LLVMContext::yield
void yield()
Calls the yield callback (if applicable).
Definition:LLVMContext.cpp:201
llvm::LLVMContext::setDiagnosticsHotnessThreshold
void setDiagnosticsHotnessThreshold(std::optional< uint64_t > Threshold)
Set the minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.
Definition:LLVMContext.cpp:140
llvm::LLVMContext::setMainRemarkStreamer
void setMainRemarkStreamer(std::unique_ptr< remarks::RemarkStreamer > MainRemarkStreamer)
Definition:LLVMContext.cpp:170
llvm::LLVMContext::isDiagnosticsHotnessThresholdSetFromPSI
bool isDiagnosticsHotnessThresholdSetFromPSI() const
Return if hotness threshold is requested from PSI.
Definition:LLVMContext.cpp:160
llvm::LLVMContext::setOptPassGate
void setOptPassGate(OptPassGate &)
Set the object which can disable optional passes and individual optimizations at compile time.
Definition:LLVMContext.cpp:353
llvm::LLVMContext::getOrInsertBundleTag
StringMapEntry< uint32_t > * getOrInsertBundleTag(StringRef TagName) const
getOrInsertBundleTag - Returns the Tag to use for an operand bundle of name TagName.
Definition:LLVMContext.cpp:298
llvm::LLVMContext::operator=
LLVMContext & operator=(const LLVMContext &)=delete
llvm::LLVMContext::setDiagnosticsHotnessRequested
void setDiagnosticsHotnessRequested(bool Requested)
Set if a code hotness metric should be included in optimization diagnostics.
Definition:LLVMContext.cpp:133
llvm::LLVMContext::setGC
void setGC(const Function &Fn, std::string GCName)
Define the GC for a function.
Definition:LLVMContext.cpp:318
llvm::LLVMContext::shouldDiscardValueNames
bool shouldDiscardValueNames() const
Return true if the Context runtime configuration is set to discard all value names.
Definition:LLVMContext.cpp:330
llvm::LLVMContext::YieldCallbackTy
void(*)(LLVMContext *Context, void *OpaqueHandle) YieldCallbackTy
Defines the type of a yield callback.
Definition:LLVMContext.h:168
llvm::LLVMContext::isODRUniquingDebugTypes
bool isODRUniquingDebugTypes() const
Whether there is a string map for uniquing debug info identifiers across the context.
Definition:LLVMContext.cpp:334
llvm::LLVMContext::generateMachineFunctionNum
unsigned generateMachineFunctionNum(Function &)
generateMachineFunctionNum - Get a unique number for MachineFunction that associated with the given F...
Definition:LLVMContext.cpp:109
llvm::LLVMContext::getDefaultTargetFeatures
StringRef getDefaultTargetFeatures()
Similar to {get,set}DefaultTargetCPU() but for default target-features.
Definition:LLVMContext.cpp:373
llvm::LLVMContext::setDiagnosticsMisExpectTolerance
void setDiagnosticsMisExpectTolerance(std::optional< uint32_t > Tolerance)
Definition:LLVMContext.cpp:152
llvm::LLVMContext::pImpl
LLVMContextImpl *const pImpl
Definition:LLVMContext.h:69
llvm::LLVMContext::LLVMContext
LLVMContext(const LLVMContext &)=delete
llvm::LLVMContext::diagnose
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
Definition:LLVMContext.cpp:245
llvm::LLVMContext::getOperandBundleTags
void getOperandBundleTags(SmallVectorImpl< StringRef > &Result) const
getOperandBundleTags - Populate client supplied SmallVector with the bundle tags registered in this L...
Definition:LLVMContext.cpp:293
llvm::LLVMContext::setDiagnosticHandlerCallBack
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 ...
Definition:LLVMContext.cpp:119
llvm::LLVMContext::setDiscardValueNames
void setDiscardValueNames(bool Discard)
Set the Context runtime configuration to discard all value name (but GlobalValue).
Definition:LLVMContext.cpp:345
llvm::LLVMContext::OB_preallocated
@ OB_preallocated
Definition:LLVMContext.h:93
llvm::LLVMContext::OB_gc_transition
@ OB_gc_transition
Definition:LLVMContext.h:91
llvm::LLVMContext::OB_deopt
@ OB_deopt
Definition:LLVMContext.h:89
llvm::LLVMContext::OB_clang_arc_attachedcall
@ OB_clang_arc_attachedcall
Definition:LLVMContext.h:95
llvm::LLVMContext::OB_cfguardtarget
@ OB_cfguardtarget
Definition:LLVMContext.h:92
llvm::LLVMContext::OB_funclet
@ OB_funclet
Definition:LLVMContext.h:90
llvm::LLVMContext::OB_convergencectrl
@ OB_convergencectrl
Definition:LLVMContext.h:98
llvm::LLVMContext::OB_kcfi
@ OB_kcfi
Definition:LLVMContext.h:97
llvm::LLVMContext::OB_ptrauth
@ OB_ptrauth
Definition:LLVMContext.h:96
llvm::LLVMContext::OB_gc_live
@ OB_gc_live
Definition:LLVMContext.h:94
llvm::LLVMContext::getDefaultTargetCPU
StringRef getDefaultTargetCPU()
Get or set the current "default" target CPU (target-cpu function attribute).
Definition:LLVMContext.cpp:365
llvm::LLVMContext::getMDKindNames
void getMDKindNames(SmallVectorImpl< StringRef > &Result) const
getMDKindNames - Populate client supplied SmallVector with the name for custom metadata IDs registere...
Definition:LLVMContext.cpp:286
llvm::LLVMContext::getDiagnosticContext
void * getDiagnosticContext() const
getDiagnosticContext - Return the diagnostic context set by setDiagnosticContext.
Definition:LLVMContext.cpp:191
llvm::LLVMContext::getOrInsertSyncScopeID
SyncScope::ID getOrInsertSyncScopeID(StringRef SSN)
getOrInsertSyncScopeID - Maps synchronization scope name to synchronization scope ID.
Definition:LLVMContext.cpp:306
llvm::LLVMContext::getDiagnosticsHotnessThreshold
uint64_t getDiagnosticsHotnessThreshold() const
Return the minimum hotness value a diagnostic would need in order to be included in optimization diag...
Definition:LLVMContext.cpp:149
llvm::LLVMContext::setDefaultTargetFeatures
void setDefaultTargetFeatures(StringRef Features)
Definition:LLVMContext.cpp:377
llvm::LLVMContext::getDiagHandlerPtr
const DiagnosticHandler * getDiagHandlerPtr() const
getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler.
Definition:LLVMContext.cpp:357
llvm::LLVMContext::setDiagnosticHandler
void setDiagnosticHandler(std::unique_ptr< DiagnosticHandler > &&DH, bool RespectFilters=false)
setDiagnosticHandler - This method sets unique_ptr to object of DiagnosticHandler to provide custom d...
Definition:LLVMContext.cpp:127
llvm::LLVMContext::getOptPassGate
OptPassGate & getOptPassGate() const
Access the object which can disable optional passes and individual optimizations at compile time.
Definition:LLVMContext.cpp:349
llvm::LLVMContext::getLLVMRemarkStreamer
LLVMRemarkStreamer * getLLVMRemarkStreamer()
The "LLVM remark streamer" used by LLVM to serialize remark diagnostics comming from IR and MIR passe...
Definition:LLVMContext.cpp:175
llvm::LLVMContext::getSyncScopeNames
void getSyncScopeNames(SmallVectorImpl< StringRef > &SSNs) const
getSyncScopeNames - Populates client supplied SmallVector with synchronization scope names registered...
Definition:LLVMContext.cpp:310
llvm::LLVMContext::getDiagnosticsMisExpectTolerance
uint32_t getDiagnosticsMisExpectTolerance() const
Definition:LLVMContext.cpp:156
llvm::LLVMRemarkStreamer
Streamer for LLVM remarks which has logic for dealing with DiagnosticInfo objects.
Definition:LLVMRemarkStreamer.h:34
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition:Module.h:65
llvm::OptPassGate
Extensions to this class implement mechanisms to disable passes and individual optimizations at compi...
Definition:OptBisect.h:24
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition:SmallVector.h:573
llvm::StringMapEntry
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
Definition:StringMapEntry.h:102
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:StringRef.h:51
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition:Twine.h:81
llvm::remarks::RemarkStreamer
Definition:RemarkStreamer.h:44
uint32_t
uint64_t
uint8_t
LLVMContextRef
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition:Types.h:53
llvm::SyncScope::ID
uint8_t ID
Definition:LLVMContext.h:46
llvm::SyncScope::SingleThread
@ SingleThread
Synchronized with respect to signal handlers executing in the same thread.
Definition:LLVMContext.h:54
llvm::SyncScope::System
@ System
Synchronized with respect to all concurrently executing threads.
Definition:LLVMContext.h:57
llvm::codeview::PublicSymFlags::Function
@ Function
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::unwrap
Attribute unwrap(LLVMAttributeRef Attr)
Definition:Attributes.h:335
llvm::DiagnosticSeverity
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
Definition:DiagnosticInfo.h:49
llvm::HighlightColor::Tag
@ Tag
llvm::wrap
LLVMAttributeRef wrap(Attribute Attr)
Definition:Attributes.h:330
llvm::DiagnosticHandler
This is the base class for diagnostic handling in LLVM.
Definition:DiagnosticHandler.h:24
llvm::DiagnosticHandler::DiagnosticHandlerTy
void(*)(const DiagnosticInfo *DI, void *Context) DiagnosticHandlerTy
Definition:DiagnosticHandler.h:31

Generated on Thu Jul 17 2025 10:05:31 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp