diff options
| author | Duncan Sands <baldrick@free.fr> | 2008-09-19 07:57:09 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2008-09-19 07:57:09 +0000 |
| commit | 938e8f60d6527d6daa12e31d57e376e68b7fda4b (patch) | |
| tree | 2be9baf25c8b3a12ed88009b652e402de07e7e2e /llvm/tools | |
| parent | a8e88ecda6bf95fa0443dcdbad72257933d2ee3e (diff) | |
| download | bcm5719-llvm-938e8f60d6527d6daa12e31d57e376e68b7fda4b.tar.gz bcm5719-llvm-938e8f60d6527d6daa12e31d57e376e68b7fda4b.zip | |
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.
llvm-svn: 56337
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/opt/AnalysisWrappers.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/tools/opt/AnalysisWrappers.cpp b/llvm/tools/opt/AnalysisWrappers.cpp index dcc8dbb49ef..454e73872ea 100644 --- a/llvm/tools/opt/AnalysisWrappers.cpp +++ b/llvm/tools/opt/AnalysisWrappers.cpp @@ -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"); |

