[llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraph.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Nov 3 18:22:10 PST 2002


Changes in directory llvm/lib/Analysis/IPA:

CallGraph.cpp updated: 1.22 -> 1.23

---
Log message:

Allow the call graph to be called from analyze naturally with print implemented



---
Diffs of the changes:

Index: llvm/lib/Analysis/IPA/CallGraph.cpp
diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.22 llvm/lib/Analysis/IPA/CallGraph.cpp:1.23
--- llvm/lib/Analysis/IPA/CallGraph.cpp:1.22	Wed Aug 21 12:09:39 2002
+++ llvm/lib/Analysis/IPA/CallGraph.cpp	Sun Nov  3 18:21:19 2002
@@ -130,8 +130,7 @@
   FunctionMap.clear();
 }
 
-
-void WriteToOutput(const CallGraphNode *CGN, std::ostream &o) {
+static void WriteToOutput(const CallGraphNode *CGN, std::ostream &o) {
   if (CGN->getFunction())
     o << "Call graph node for function: '"
       << CGN->getFunction()->getName() <<"'\n";
@@ -146,11 +145,11 @@
   o << "\n";
 }
 
-void WriteToOutput(const CallGraph &CG, std::ostream &o) {
-  o << "CallGraph Root is:\n" << CG.getRoot();
+void CallGraph::print(std::ostream &o, const Module *M) const {
+  o << "CallGraph Root is:\n" << getRoot();
 
-  for (CallGraph::const_iterator I = CG.begin(), E = CG.end(); I != E; ++I)
-    o << I->second;
+  for (CallGraph::const_iterator I = begin(), E = end(); I != E; ++I)
+    WriteToOutput(I->second, o);
 }
 
 





More information about the llvm-commits mailing list