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 | 35f0c49febce4ba426fc48b4f4d4a37dccfe16fa (patch) | |
tree | a29b9a19cb975f7300e423df8103363242ab370b /llvm/lib | |
parent | b05cd8a88df5004719f1d965bf5582b84b2f4191 (diff) | |
download | bcm5719-llvm-35f0c49febce4ba426fc48b4f4d4a37dccfe16fa.tar.gz bcm5719-llvm-35f0c49febce4ba426fc48b4f4d4a37dccfe16fa.zip |
Add new -only-print-main-ds option that causes mains ds graph to be
printed, but no others.
llvm-svn: 3178
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/Printer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Printer.cpp b/llvm/lib/Analysis/DataStructure/Printer.cpp index 00418f8013f..986c28d0a88 100644 --- a/llvm/lib/Analysis/DataStructure/Printer.cpp +++ b/llvm/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); } |