#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;
}
}
+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) {
}
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);
}