mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-16 08:29:08 +00:00
Add new -only-print-main-ds option that causes mains ds graph to be
printed, but no others. llvm-svn: 3178
This commit is contained in:
parent
0e8dd86318
commit
d376feeb74
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user