#include "llvm/IR/DiagnosticHandler.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Regex.h"
usingnamespacellvm;
namespace {
struct PassRemarksOpt { … };
static PassRemarksOpt PassRemarksPassedOptLoc;
static PassRemarksOpt PassRemarksMissedOptLoc;
static PassRemarksOpt PassRemarksAnalysisOptLoc;
static cl::opt<PassRemarksOpt, true, cl::parser<std::string>> PassRemarks(
"pass-remarks", cl::value_desc("pattern"),
cl::desc("Enable optimization remarks from passes whose name match "
"the given regular expression"),
cl::Hidden, cl::location(PassRemarksPassedOptLoc), cl::ValueRequired);
static cl::opt<PassRemarksOpt, true, cl::parser<std::string>> PassRemarksMissed(
"pass-remarks-missed", cl::value_desc("pattern"),
cl::desc("Enable missed optimization remarks from passes whose name match "
"the given regular expression"),
cl::Hidden, cl::location(PassRemarksMissedOptLoc), cl::ValueRequired);
static cl::opt<PassRemarksOpt, true, cl::parser<std::string>>
PassRemarksAnalysis(
"pass-remarks-analysis", cl::value_desc("pattern"),
cl::desc(
"Enable optimization analysis remarks from passes whose name match "
"the given regular expression"),
cl::Hidden, cl::location(PassRemarksAnalysisOptLoc), cl::ValueRequired);
}
bool DiagnosticHandler::isAnalysisRemarkEnabled(StringRef PassName) const { … }
bool DiagnosticHandler::isMissedOptRemarkEnabled(StringRef PassName) const { … }
bool DiagnosticHandler::isPassedOptRemarkEnabled(StringRef PassName) const { … }
bool DiagnosticHandler::isAnyRemarkEnabled() const { … }