[llvm-commits] CVS: llvm/tools/analyze/AnalysisWrappers.cpp

2006-04-18 Thread Andrew Lenharth


Changes in directory llvm/tools/analyze:

AnalysisWrappers.cpp updated: 1.17 - 1.18
---
Log message:

fix printing call graphs

---
Diffs of the changes:  (+1 -1)

 AnalysisWrappers.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/tools/analyze/AnalysisWrappers.cpp
diff -u llvm/tools/analyze/AnalysisWrappers.cpp:1.17 
llvm/tools/analyze/AnalysisWrappers.cpp:1.18
--- llvm/tools/analyze/AnalysisWrappers.cpp:1.17Thu Dec 22 13:26:06 2005
+++ llvm/tools/analyze/AnalysisWrappers.cpp Tue Apr 18 18:45:19 2006
@@ -71,7 +71,7 @@
 }
 virtual bool runOnModule(Module M) { return false; }
 
-void print(std::ostream OS, Module *M) const {
+virtual void print(std::ostream OS, const Module *M) const {
   getAnalysisCallGraph().print(OS, M);
 }
   };



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/analyze/AnalysisWrappers.cpp

2005-12-22 Thread Chris Lattner


Changes in directory llvm/tools/analyze:

AnalysisWrappers.cpp updated: 1.16 - 1.17
---
Log message:

Fix test/Regression/Other/2002-01-31-CallGraph.ll after the recent callgraph
rework.


---
Diffs of the changes:  (+17 -3)

 AnalysisWrappers.cpp |   20 +---
 1 files changed, 17 insertions(+), 3 deletions(-)


Index: llvm/tools/analyze/AnalysisWrappers.cpp
diff -u llvm/tools/analyze/AnalysisWrappers.cpp:1.16 
llvm/tools/analyze/AnalysisWrappers.cpp:1.17
--- llvm/tools/analyze/AnalysisWrappers.cpp:1.16Thu Apr 21 18:59:21 2005
+++ llvm/tools/analyze/AnalysisWrappers.cpp Thu Dec 22 13:26:06 2005
@@ -20,6 +20,7 @@
 #include llvm/Module.h
 #include llvm/Pass.h
 #include llvm/Support/CallSite.h
+#include llvm/Analysis/CallGraph.h
 #include iostream
 using namespace llvm;
 
@@ -55,13 +56,26 @@
   return false;
 }
 
-void print(std::ostream OS) const {}
-
 virtual void getAnalysisUsage(AnalysisUsage AU) const {
   AU.setPreservesAll();
 }
   };
 
   RegisterAnalysisExternalFunctionsPassedConstants
-  P2(externalfnconstants, Print external fn callsites passed constants);
+  P1(externalfnconstants, Print external fn callsites passed constants);
+  
+  struct CallGraphPrinter : public ModulePass {
+virtual void getAnalysisUsage(AnalysisUsage AU) const {
+  AU.setPreservesAll();
+  AU.addRequiredCallGraph();
+}
+virtual bool runOnModule(Module M) { return false; }
+
+void print(std::ostream OS, Module *M) const {
+  getAnalysisCallGraph().print(OS, M);
+}
+  };
+  
+  RegisterAnalysisCallGraphPrinter
+P2(callgraph, Print a call graph);
 }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits