40 assert(DbgID ==
MD_dbg &&
"dbg kind id drifted"); (void)DbgID;
44 assert(TBAAID ==
MD_tbaa &&
"tbaa kind id drifted"); (void)TBAAID;
48 assert(ProfID ==
MD_prof &&
"prof kind id drifted"); (void)ProfID;
52 assert(FPAccuracyID ==
MD_fpmath &&
"fpmath kind id drifted");
57 assert(RangeID ==
MD_range &&
"range kind id drifted");
62 assert(TBAAStructID ==
MD_tbaa_struct &&
"tbaa.struct kind id drifted");
66 unsigned InvariantLdId =
getMDKindID(
"invariant.load");
72 assert(AliasScopeID ==
MD_alias_scope &&
"alias.scope kind id drifted");
77 assert(NoAliasID ==
MD_noalias &&
"noalias kind id drifted");
81 unsigned NonTemporalID =
getMDKindID(
"nontemporal");
82 assert(NonTemporalID ==
MD_nontemporal &&
"nontemporal kind id drifted");
86 unsigned MemParallelLoopAccessID =
getMDKindID(
"llvm.mem.parallel_loop_access");
88 "mem_parallel_loop_access kind id drifted");
89 (void)MemParallelLoopAccessID;
93 assert(NonNullID ==
MD_nonnull &&
"nonnull kind id drifted");
97 unsigned DereferenceableID =
getMDKindID(
"dereferenceable");
99 "dereferenceable kind id drifted");
100 (void)DereferenceableID;
103 unsigned DereferenceableOrNullID =
getMDKindID(
"dereferenceable_or_null");
105 "dereferenceable_or_null kind id drifted");
106 (void)DereferenceableOrNullID;
110 void LLVMContext::addModule(
Module *M) {
114 void LLVMContext::removeModule(
Module *M) {
143 void *DiagnosticContext,
144 bool RespectFilters) {
174 assert (I &&
"Invalid instruction");
185 if (!cast<DiagnosticInfoOptimizationRemark>(DI).isEnabled())
189 if (!cast<DiagnosticInfoOptimizationRemarkMissed>(DI).isEnabled())
193 if (!cast<DiagnosticInfoOptimizationRemarkAnalysis>(DI).isEnabled())
259 Names[
I->second] =
I->first();
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
InlineAsmDiagHandlerTy getInlineAsmDiagnosticHandler() const
getInlineAsmDiagnosticHandler - Return the diagnostic handler set by setInlineAsmDiagnosticHandler.
A Module instance is used to store all the information related to an LLVM module. ...
void(* DiagnosticHandlerTy)(const DiagnosticInfo &DI, void *Context)
Defines the type of a diagnostic handler.
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
DiagnosticHandlerTy getDiagnosticHandler() const
getDiagnosticHandler - Return the diagnostic handler set by setDiagnosticHandler. ...
void setInlineAsmDiagnosticHandler(InlineAsmDiagHandlerTy DiagHandler, void *DiagContext=nullptr)
setInlineAsmDiagnosticHandler - This method sets a handler that is invoked when problems with inline ...
void setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle)
Registers a yield callback with the given context.
bool RespectDiagnosticFilters
void yield()
Calls the yield callback (if applicable).
LLVMContext::InlineAsmDiagHandlerTy InlineAsmDiagHandler
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void emitError(unsigned LocCookie, const Twine &ErrorStr)
emitError - Emit an error message to the currently installed error handler with optional location inf...
static const char * getDiagnosticMessagePrefix(DiagnosticSeverity Severity)
DiagnosticSeverity getSeverity() const
static ManagedStatic< LLVMContext > GlobalContext
LLVMContext::YieldCallbackTy YieldCallback
void getMDKindNames(SmallVectorImpl< StringRef > &Result) const
getMDKindNames - Populate client supplied SmallVector with the name for custom metadata IDs registere...
StringMap< unsigned > CustomMDKindNames
CustomMDKindNames - Map to hold the metadata string to ID mapping.
This is the base abstract class for diagnostic reporting in the backend.
This is an important class for using LLVM in a threaded context.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
unsigned getMDKindID(StringRef Name) const
getMDKindID - Return a unique non-zero ID for the specified metadata kind.
void * getDiagnosticContext() const
getDiagnosticContext - Return the diagnostic context set by setDiagnosticContext. ...
Diagnostic information for inline asm reporting.
virtual void print(DiagnosticPrinter &DP) const =0
Print using the given DP a user-friendly message.
void * InlineAsmDiagContext
LLVMContextImpl *const pImpl
bool erase(PtrType Ptr)
erase - If the set contains the specified pointer, remove it and return true, otherwise return false...
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
SmallPtrSet< Module *, 4 > OwnedModules
OwnedModules - The set of modules instantiated in this context, and which will be automatically delet...
void(* InlineAsmDiagHandlerTy)(const SMDiagnostic &, void *Context, unsigned LocCookie)
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
Basic diagnostic printer that uses an underlying raw_ostream.
void * getInlineAsmDiagnosticContext() const
getInlineAsmDiagnosticContext - Return the diagnostic context set by setInlineAsmDiagnosticHandler.
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
void setDiagnosticHandler(DiagnosticHandlerTy DiagHandler, void *DiagContext=nullptr, bool RespectFilters=false)
setDiagnosticHandler - This method sets a handler that is invoked when the backend needs to report an...
LLVMContext::DiagnosticHandlerTy DiagnosticHandler
StringRef - Represent a constant reference to a string, i.e.
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
static bool isDiagnosticEnabled(const DiagnosticInfo &DI)
LLVMContext & getGlobalContext()
getGlobalContext - Returns a global context.