From e65d39a42ccb63c8b883db0c466cc43f42d83fff Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Fri, 19 Sep 2008 07:57:09 +0000 Subject: 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 --- tools/opt/AnalysisWrappers.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/opt/AnalysisWrappers.cpp b/tools/opt/AnalysisWrappers.cpp index dcc8dbb..454e738 100644 --- a/tools/opt/AnalysisWrappers.cpp +++ b/tools/opt/AnalysisWrappers.cpp @@ -66,7 +66,7 @@ namespace { char ExternalFunctionsPassedConstants::ID = 0; RegisterPass 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(); } - virtual bool runOnModule(Module &M) { return false; } - - virtual void print(std::ostream &OS, const Module *M) const { - getAnalysis().print(OS, M); + virtual bool runOnModule(Module &M) { + getAnalysis().print(std::cerr, &M); + return false; } }; - + char CallGraphPrinter::ID = 0; RegisterPass P2("callgraph", "Print a call graph"); -- cgit v1.1