38 std::pair<unsigned, StringRef> MDKinds[] = {
63 for (
auto &MDKind : MDKinds) {
65 assert(ID == MDKind.first &&
"metadata kind id drifted");
71 "deopt operand bundle id drifted!");
76 "funclet operand bundle id drifted!");
81 "gc-transition operand bundle id drifted!");
82 (void)GCTransitionEntry;
87 void LLVMContext::addModule(
Module *M) {
91 void LLVMContext::removeModule(
Module *M) {
120 void *DiagnosticContext,
121 bool RespectFilters) {
166 assert (I &&
"Invalid instruction");
175 if (
auto *Remark = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
176 return Remark->isEnabled();
239 Names[
I->second] =
I->first();
254 pImpl->
GCNames.insert(std::make_pair(&Fn, std::move(GCName)));
257 It->second = std::move(GCName);
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
void setDiagnosticsOutputFile(std::unique_ptr< yaml::Output > F)
Set the diagnostics output file used for optimization diagnostics.
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. ...
const std::string & getGC(const Function &Fn)
Return the GC for a function.
void(* DiagnosticHandlerTy)(const DiagnosticInfo &DI, void *Context)
Defines the type of a diagnostic handler.
bool shouldDiscardValueNames() const
Return true if the Context runtime configuration is set to discard all value names.
DiagnosticHandlerTy getDiagnosticHandler() const
getDiagnosticHandler - Return the diagnostic handler set by setDiagnosticHandler. ...
void setGC(const Function &Fn, std::string GCName)
Define the GC for a function.
void enableDebugTypeODRUniquing()
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
void setDiscardValueNames(bool Discard)
Set the Context runtime configuration to discard all value name (but GlobalValue).
void disableDebugTypeODRUniquing()
bool isODRUniquingDebugTypes() const
Whether there is a string map for uniquing debug info identifiers across the context.
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
OptBisect & getOptBisect()
Access the object which manages optimization bisection for failure analysis.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
void setDiagnosticHotnessRequested(bool Requested)
Set if a code hotness metric should be included in optimization diagnostics.
void deleteGC(const Function &Fn)
Remove the GC for a function.
bool DiscardValueNames
Flag to indicate if Value (other than GlobalValue) retains their name or not.
void emitError(unsigned LocCookie, const Twine &ErrorStr)
emitError - Emit an error message to the currently installed error handler with optional location inf...
DiagnosticSeverity getSeverity() const
yaml::Output * getDiagnosticsOutputFile()
Return the YAML file used by the backend to save optimization diagnostics.
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
LLVMContext::YieldCallbackTy YieldCallback
void getMDKindNames(SmallVectorImpl< StringRef > &Result) const
getMDKindNames - Populate client supplied SmallVector with the name for custom metadata IDs registere...
This class implements a mechanism to disable passes and individual optimizations at compile time base...
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.
StringMapEntry< uint32_t > * getOrInsertBundleTag(StringRef Tag)
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. ...
The Output class is used to generate a yaml document from in-memory structs and vectors.
bool getDiagnosticHotnessRequested() const
Return if a code hotness metric should be included in optimization diagnostics.
uint32_t getOperandBundleTagID(StringRef Tag) const
Diagnostic information for inline asm reporting.
virtual void print(DiagnosticPrinter &DP) const =0
Print using the given DP a user-friendly message.
void * InlineAsmDiagContext
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVMContextImpl *const pImpl
void getOperandBundleTags(SmallVectorImpl< StringRef > &Result) const
getOperandBundleTags - Populate client supplied SmallVector with the bundle tags registered in this L...
bool erase(PtrType Ptr)
erase - If the set contains the specified pointer, remove it and return true, otherwise return false...
Module.h This file contains the declarations for the Module class.
static const char * getDiagnosticMessagePrefix(DiagnosticSeverity Severity)
Get the prefix that should be printed in front of a diagnostic of the given Severity.
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.
OptBisect & getOptBisect()
Access the object which manages optimization bisection for failure analysis.
uint32_t getOperandBundleTagID(StringRef Tag) const
getOperandBundleTagID - Maps a bundle tag to an integer ID.
std::unique_ptr< yaml::Output > DiagnosticsOutputFile
DenseMap< const Function *, std::string > GCNames
Maintain the GC name for each function.
bool DiagnosticHotnessRequested
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...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVMContext::DiagnosticHandlerTy DiagnosticHandler
void getOperandBundleTags(SmallVectorImpl< StringRef > &Tags) const
StringRef - Represent a constant reference to a string, i.e.
static bool isDiagnosticEnabled(const DiagnosticInfo &DI)
Optional< DenseMap< const MDString *, DICompositeType * > > DITypeMap