summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polly/lib/Analysis/ScopGraphPrinter.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/polly/lib/Analysis/ScopGraphPrinter.cpp b/polly/lib/Analysis/ScopGraphPrinter.cpp
index f39893ea8a4..ba8d1443188 100644
--- a/polly/lib/Analysis/ScopGraphPrinter.cpp
+++ b/polly/lib/Analysis/ScopGraphPrinter.cpp
@@ -20,9 +20,14 @@
#include "llvm/Analysis/DOTGraphTraitsPass.h"
#include "llvm/Analysis/RegionInfo.h"
#include "llvm/Analysis/RegionIterator.h"
+#include "llvm/Support/CommandLine.h"
using namespace polly;
using namespace llvm;
+static cl::opt<std::string>
+ ViewFilter("polly-view-only",
+ cl::desc("Only view functions that match this pattern"),
+ cl::Hidden, cl::init(""), cl::ZeroOrMore);
namespace llvm {
template <>
@@ -173,6 +178,15 @@ struct DOTGraphTraits<ScopDetection *> : public DOTGraphTraits<RegionNode *> {
struct ScopViewer : public DOTGraphTraitsViewer<ScopDetection, false> {
static char ID;
ScopViewer() : DOTGraphTraitsViewer<ScopDetection, false>("scops", ID) {}
+ bool processFunction(Function &F) override {
+ if (ViewFilter == "")
+ return true;
+
+ if (F.getName().count(ViewFilter))
+ return true;
+
+ return false;
+ }
};
char ScopViewer::ID = 0;
OpenPOWER on IntegriCloud