summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llc/llc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llc/llc.cpp')
-rw-r--r--llvm/tools/llc/llc.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index a566d15cd81..be103845e97 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -148,6 +148,12 @@ static cl::opt<std::string>
cl::desc("YAML output filename for pass remarks"),
cl::value_desc("filename"));
+static cl::opt<std::string>
+ RemarksPasses("pass-remarks-filter",
+ cl::desc("Only record optimization remarks from passes whose "
+ "names match the given regular expression"),
+ cl::value_desc("regex"));
+
namespace {
static ManagedStatic<std::vector<std::string>> RunPassNames;
@@ -336,6 +342,12 @@ int main(int argc, char **argv) {
}
Context.setRemarkStreamer(
llvm::make_unique<RemarkStreamer>(RemarksFilename, YamlFile->os()));
+
+ if (!RemarksPasses.empty())
+ if (Error E = Context.getRemarkStreamer()->setFilter(RemarksPasses)) {
+ WithColor::error(errs(), argv[0]) << E << '\n';
+ return 1;
+ }
}
if (InputLanguage != "" && InputLanguage != "ir" &&
OpenPOWER on IntegriCloud