39 struct PassRemarksOpt {
40 std::shared_ptr<Regex> Pattern;
42 void operator=(
const std::string &Val) {
45 Pattern = std::make_shared<Regex>(Val);
46 std::string RegexError;
47 if (!Pattern->isValid(RegexError))
49 "' in -pass-remarks: " + RegexError,
55 static PassRemarksOpt PassRemarksOptLoc;
56 static PassRemarksOpt PassRemarksMissedOptLoc;
57 static PassRemarksOpt PassRemarksAnalysisOptLoc;
63 cl::desc(
"Enable optimization remarks from passes whose name match "
64 "the given regular expression"),
72 cl::desc(
"Enable missed optimization remarks from passes whose name match "
73 "the given regular expression"),
83 "Enable optimization analysis remarks from passes whose name match "
84 "the given regular expression"),
91 return ++PluginKindID;
100 if (SrcLoc->getNumOperands() != 0)
102 mdconst::dyn_extract<ConstantInt>(SrcLoc->getOperand(0)))
103 LocCookie = CI->getZExtValue();
114 DP <<
"stack size limit exceeded (" <<
getStackSize() <<
") in "
137 unsigned *Column)
const {
139 assert(L !=
nullptr &&
"debug location is invalid");
140 *Filename = L->getFilename();
141 *Line = L->getLine();
142 *Column = L->getColumn();
151 return (Filename +
":" +
Twine(Line) +
":" +
Twine(Column)).str();
159 return PassRemarksOptLoc.Pattern &&
164 return PassRemarksMissedOptLoc.Pattern &&
165 PassRemarksMissedOptLoc.Pattern->match(
getPassName());
169 return PassRemarksAnalysisOptLoc.Pattern &&
170 PassRemarksAnalysisOptLoc.Pattern->match(
getPassName());
191 const char *PassName,
207 Fn, DLoc,
Twine(
"loop not vectorized: " + Msg)));
213 Fn, DLoc,
Twine(
"loop not interleaved: " + Msg)));
void getLocation(StringRef *Filename, unsigned *Line, unsigned *Column) const
Return location information for this diagnostic in three parts: the source file name, line number and column.
unsigned getStackSize() const
DiagnosticInfoInlineAsm(const Twine &MsgStr, DiagnosticSeverity Severity=DS_Error)
MsgStr is the message to be reported to the frontend.
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
void print(DiagnosticPrinter &DP) const override
void emitOptimizationRemark(LLVMContext &Ctx, const char *PassName, const Function &Fn, const DebugLoc &DLoc, const Twine &Msg)
Emit an optimization-applied message.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
Reports a serious error, calling any installed error handler.
void emitOptimizationRemarkAnalysis(LLVMContext &Ctx, const char *PassName, const Function &Fn, const DebugLoc &DLoc, const Twine &Msg)
Emit an optimization analysis remark message.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
const char * getPassName() const
Diagnostic information for optimization failures.
Interface for custom diagnostic printing.
const char * getFileName() const
bool isEnabled() const override
const DebugLoc & getDebugLoc() const
void emitOptimizationRemarkMissed(LLVMContext &Ctx, const char *PassName, const Function &Fn, const DebugLoc &DLoc, const Twine &Msg)
Emit an optimization-missed message.
DiagnosticSeverity getSeverity() const
This is the base abstract class for diagnostic reporting in the backend.
bool isLocationAvailable() const
Return true if location information is available for this diagnostic.
const Twine & getMsg() const
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...
const std::string getLocationStr() const
Return a string with the location information for this diagnostic in the format "file:line:col".
void emitLoopVectorizeWarning(LLVMContext &Ctx, const Function &Fn, const DebugLoc &DLoc, const Twine &Msg)
Emit a warning when loop vectorization is specified but fails.
void emitLoopInterleaveWarning(LLVMContext &Ctx, const Function &Fn, const DebugLoc &DLoc, const Twine &Msg)
Emit a warning when loop interleaving is specified but fails.
unsigned getLocCookie() const
Module.h This file contains the declarations for the Module class.
MDNode * getMetadata(unsigned KindID) const
getMetadata - Get the metadata of given kind attached to this Instruction.
unsigned getLineNum() const
int getNextAvailablePluginDiagnosticKind()
Get the next available kind ID for a plugin diagnostic.
const Function & getFunction() const
void print(DiagnosticPrinter &DP) const override
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
const Twine & getMsgStr() const
const Twine & getMsg() const
void print(DiagnosticPrinter &DP) const override
StringRef - Represent a constant reference to a string, i.e.
void print(DiagnosticPrinter &DP) const override
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
LocationClass< Ty > location(Ty &L)