24struct PassRemarksOpt {
27 void operator=(
const std::string &Val) {
30 Pattern = std::make_shared<Regex>(Val);
31 std::string RegexError;
32 if (!
Pattern->isValid(RegexError))
34 "' in -pass-remarks: " + RegexError,
40static PassRemarksOpt PassRemarksPassedOptLoc;
41static PassRemarksOpt PassRemarksMissedOptLoc;
42static PassRemarksOpt PassRemarksAnalysisOptLoc;
48 cl::desc(
"Enable optimization remarks from passes whose name match "
49 "the given regular expression"),
56 cl::desc(
"Enable missed optimization remarks from passes whose name match "
57 "the given regular expression"),
66 "Enable optimization analysis remarks from passes whose name match "
67 "the given regular expression"),
72 return (PassRemarksAnalysisOptLoc.Pattern &&
73 PassRemarksAnalysisOptLoc.Pattern->match(
PassName));
76 return (PassRemarksMissedOptLoc.Pattern &&
77 PassRemarksMissedOptLoc.Pattern->match(
PassName));
80 return (PassRemarksPassedOptLoc.Pattern &&
81 PassRemarksPassedOptLoc.Pattern->match(
PassName));
85 return (PassRemarksPassedOptLoc.Pattern || PassRemarksMissedOptLoc.Pattern ||
86 PassRemarksAnalysisOptLoc.Pattern);
static const char PassName[]
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LocationClass< Ty > location(Ty &L)
This is an optimization pass for GlobalISel generic memory operations.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
virtual bool isPassedOptRemarkEnabled(StringRef PassName) const
Return true if passed optimization remarks are enabled, override to provide different implementation.
virtual bool isAnalysisRemarkEnabled(StringRef PassName) const
Return true if analysis remarks are enabled, override to provide different implementation.
virtual bool isMissedOptRemarkEnabled(StringRef PassName) const
Return true if missed optimization remarks are enabled, override to provide different implementation.
virtual bool isAnyRemarkEnabled() const
Return true if any type of remarks are enabled for any pass.