[llvm-commits] [llvm] r56337 - in /llvm/trunk: test/Analysis/CallGraph/2008-09-09-DirectCall.ll test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll test/Other/2002-01-31-CallGraph.ll tools/opt/AnalysisWrappers.cpp

Duncan Sands baldrick at free.fr
Fri Sep 19 00:57:10 PDT 2008


Author: baldrick
Date: Fri Sep 19 02:57:09 2008
New Revision: 56337

URL: http://llvm.org/viewvc/llvm-project?rev=56337&view=rev
Log:
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.

Modified:
    llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll
    llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll
    llvm/trunk/test/Other/2002-01-31-CallGraph.ll
    llvm/trunk/tools/opt/AnalysisWrappers.cpp

Modified: llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll?rev=56337&r1=56336&r2=56337&view=diff

==============================================================================
--- llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll (original)
+++ llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll Fri Sep 19 02:57:09 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -analyze -callgraph -disable-output | grep {Calls function 'callee'} | count 2
+; RUN: llvm-as < %s | opt -callgraph -disable-output |& grep {Calls function 'callee'} | count 2
 
 define internal void @callee(...) {
 entry:

Modified: llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll?rev=56337&r1=56336&r2=56337&view=diff

==============================================================================
--- llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll (original)
+++ llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll Fri Sep 19 02:57:09 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -analyze -callgraph -disable-output | grep {Calls function}
+; RUN: llvm-as < %s | opt -callgraph -disable-output |& grep {Calls function}
 
 @a = global void ()* @f		; <void ()**> [#uses=0]
 

Modified: llvm/trunk/test/Other/2002-01-31-CallGraph.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/2002-01-31-CallGraph.ll?rev=56337&r1=56336&r2=56337&view=diff

==============================================================================
--- llvm/trunk/test/Other/2002-01-31-CallGraph.ll (original)
+++ llvm/trunk/test/Other/2002-01-31-CallGraph.ll Fri Sep 19 02:57:09 2008
@@ -1,6 +1,6 @@
 ;  Call graph construction crash: Not handling indirect calls right
 ;
-; RUN: llvm-as < %s | opt -analyze -callgraph
+; RUN: llvm-as < %s | opt -analyze -callgraph >& /dev/null
 ;
 
         %FunTy = type i32 (i32)

Modified: llvm/trunk/tools/opt/AnalysisWrappers.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/AnalysisWrappers.cpp?rev=56337&r1=56336&r2=56337&view=diff

==============================================================================
--- llvm/trunk/tools/opt/AnalysisWrappers.cpp (original)
+++ llvm/trunk/tools/opt/AnalysisWrappers.cpp Fri Sep 19 02:57:09 2008
@@ -66,7 +66,7 @@
   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 @@
       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");





More information about the llvm-commits mailing list