diff options
author | Chris Lattner <sabre@nondot.org> | 2002-07-31 17:15:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-07-31 17:15:40 +0000 |
commit | dadd49bdb80a8903a9d583e0321349ea9005ef60 (patch) | |
tree | c62b6944678f8261f801c2f0e1ed3482f5c73ae8 | |
parent | f9e173e85ab1e4062cc723cab6db0b86ed2578b8 (diff) | |
download | external_llvm-dadd49bdb80a8903a9d583e0321349ea9005ef60.zip external_llvm-dadd49bdb80a8903a9d583e0321349ea9005ef60.tar.gz external_llvm-dadd49bdb80a8903a9d583e0321349ea9005ef60.tar.bz2 |
Add new -only-print-main-ds option that causes mains ds graph to be
printed, but no others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3178 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Analysis/DataStructure/Printer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Analysis/DataStructure/Printer.cpp b/lib/Analysis/DataStructure/Printer.cpp index 00418f8..986c28d 100644 --- a/lib/Analysis/DataStructure/Printer.cpp +++ b/lib/Analysis/DataStructure/Printer.cpp @@ -7,6 +7,7 @@ #include "llvm/Analysis/DataStructure.h" #include "llvm/Module.h" #include "llvm/Assembly/Writer.h" +#include "Support/CommandLine.h" #include <fstream> #include <sstream> using std::string; @@ -166,6 +167,8 @@ static void printGraph(const DSGraph &Graph, std::ostream &O, } } +static cl::opt<bool> OnlyPrintMain("only-print-main-ds", cl::ReallyHidden); + template <typename Collection> static void printCollection(const Collection &C, std::ostream &O, const Module *M, const string &Prefix) { @@ -175,7 +178,7 @@ static void printCollection(const Collection &C, std::ostream &O, } for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) - if (!I->isExternal()) + if (!I->isExternal() && (I->getName() == "main" || !OnlyPrintMain)) printGraph(C.getDSGraph((Function&)*I), O, I->getName(), Prefix); } |