Teach -callgraph to always print the callgraph (as the

description says it does), not just when -analyze is
used as well.  This means printing to stderr, so adjust
some tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56337 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands
2008-09-19 07:57:09 +00:00
parent fa48f94130
commit e65d39a42c
4 changed files with 8 additions and 9 deletions

View File

@@ -66,7 +66,7 @@ namespace {
char ExternalFunctionsPassedConstants::ID = 0;
RegisterPass<ExternalFunctionsPassedConstants>
P1("externalfnconstants", "Print external fn callsites passed constants");
struct CallGraphPrinter : public ModulePass {
static char ID; // Pass ID, replacement for typeid
CallGraphPrinter() : ModulePass((intptr_t)&ID) {}
@@ -75,13 +75,12 @@ namespace {
AU.setPreservesAll();
AU.addRequiredTransitive<CallGraph>();
}
virtual bool runOnModule(Module &M) { return false; }
virtual void print(std::ostream &OS, const Module *M) const {
getAnalysis<CallGraph>().print(OS, M);
virtual bool runOnModule(Module &M) {
getAnalysis<CallGraph>().print(std::cerr, &M);
return false;
}
};
char CallGraphPrinter::ID = 0;
RegisterPass<CallGraphPrinter>
P2("callgraph", "Print a call graph");