25 struct PassRemarksOpt {
26 std::shared_ptr<Regex> Pattern;
28 void operator=(
const std::string &Val) {
31 Pattern = std::make_shared<Regex>(Val);
32 std::string RegexError;
33 if (!Pattern->isValid(RegexError))
35 "' in -pass-remarks: " + RegexError,
41 static PassRemarksOpt PassRemarksPassedOptLoc;
42 static PassRemarksOpt PassRemarksMissedOptLoc;
43 static PassRemarksOpt PassRemarksAnalysisOptLoc;
49 cl::desc(
"Enable optimization remarks from passes whose name match " 50 "the given regular expression"),
58 cl::desc(
"Enable missed optimization remarks from passes whose name match " 59 "the given regular expression"),
69 "Enable optimization analysis remarks from passes whose name match " 70 "the given regular expression"),
76 return (PassRemarksAnalysisOptLoc.Pattern &&
77 PassRemarksAnalysisOptLoc.Pattern->match(PassName));
80 return (PassRemarksMissedOptLoc.Pattern &&
81 PassRemarksMissedOptLoc.Pattern->match(PassName));
84 return (PassRemarksPassedOptLoc.Pattern &&
85 PassRemarksPassedOptLoc.Pattern->match(PassName));
89 return (PassRemarksPassedOptLoc.Pattern || PassRemarksMissedOptLoc.Pattern ||
90 PassRemarksAnalysisOptLoc.Pattern);
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
virtual bool isMissedOptRemarkEnabled(StringRef PassName) const
Return true if missed optimization remarks are enabled, override to provide different implementation...
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 isAnyRemarkEnabled() const
Return true if any type of remarks are enabled for any pass.
StringRef - Represent a constant reference to a string, i.e.
LocationClass< Ty > location(Ty &L)