diff options
| author | Tobias Grosser <tobias@grosser.es> | 2015-08-03 16:39:56 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2015-08-03 16:39:56 +0000 |
| commit | 14e67e43a759538e6ab00624c2e50034fea4d015 (patch) | |
| tree | 299884c2a0c36ac82c66a5b80c7b89d45143314c | |
| parent | b9c77ae5ae114998949b05140c5311e21c110576 (diff) | |
| download | bcm5719-llvm-14e67e43a759538e6ab00624c2e50034fea4d015.tar.gz bcm5719-llvm-14e67e43a759538e6ab00624c2e50034fea4d015.zip | |
Add option -polly-view-only
If set, this option instructs -view-scops and -polly-show to only print
functions that contain the specified string in their name. This allows to
look at the scops of a specific function in a large .ll file, without flooding
the screen with .dot graphs.
llvm-svn: 243882
| -rw-r--r-- | polly/lib/Analysis/ScopGraphPrinter.cpp | 14 |
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; |

