Move callgraph printing out of writer.h into callgraph.h
authorChris Lattner <sabre@nondot.org>
Wed, 6 Mar 2002 17:59:45 +0000 (17:59 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 6 Mar 2002 17:59:45 +0000 (17:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1824 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/CallGraph.h
include/llvm/Analysis/Writer.h

index a2494654c5d01961c0a8be46dd941d00abbae4f1..38f26b3fd51937e0533046143912218056e7652f 100644 (file)
 #include "llvm/Pass.h"
 class Method;
 class Module;
-
 class CallGraph;
+
+//===----------------------------------------------------------------------===//
+// CallGraphNode class definition
+//
 class CallGraphNode {
   Method *Meth;
   std::vector<CallGraphNode*> CalledMethods;
@@ -59,6 +62,9 @@ private:                    // Stuff to construct the node, used by CallGraph
 };
 
 
+//===----------------------------------------------------------------------===//
+// CallGraph class definition
+//
 class CallGraph : public Pass {
   Module *Mod;              // The module this call graph represents
 
@@ -140,7 +146,10 @@ private:   // Implementation of CallGraph construction
 };
 
 
-
+//===----------------------------------------------------------------------===//
+// GraphTraits specializations for call graphs so that they can be treated as
+// graphs by the generic graph algorithms...
+//
 
 // Provide graph traits for tranversing call graphs using standard graph
 // traversals.
@@ -177,10 +186,20 @@ template<> struct GraphTraits<const CallGraph*> :
 };
 
 
-// Checks if a method contains any call instructions.
-// Note that this uses the call graph only if one is provided.
-// It does not build the call graph.
-// 
-bool isLeafMethod(const Method* method, const CallGraph *callGraph = 0);
+//===----------------------------------------------------------------------===//
+// Printing support for Call Graphs
+//
+
+// Stuff for printing out a callgraph...
+
+void WriteToOutput(const CallGraph &, std::ostream &o);
+inline std::ostream &operator <<(std::ostream &o, const CallGraph &CG) {
+  WriteToOutput(CG, o); return o;
+}
+  
+void WriteToOutput(const CallGraphNode *, std::ostream &o);
+inline std::ostream &operator <<(std::ostream &o, const CallGraphNode *CGN) {
+  WriteToOutput(CGN, o); return o;
+}
 
 #endif
index a3539a865c13fd34e9e2648123275ffa60bd95d7..7f767759efe51f33fbf36c524527d0b6b9ba8973 100644 (file)
@@ -77,18 +77,4 @@ inline std::ostream &operator <<(std::ostream &o, const InductionVariable &IV) {
   WriteToOutput(IV, o); return o;
 }
 
-// Stuff for printing out a callgraph...
-class CallGraph;
-class CallGraphNode;
-
-void WriteToOutput(const CallGraph &, std::ostream &o);
-inline std::ostream &operator <<(std::ostream &o, const CallGraph &CG) {
-  WriteToOutput(CG, o); return o;
-}
-  
-void WriteToOutput(const CallGraphNode *, std::ostream &o);
-inline std::ostream &operator <<(std::ostream &o, const CallGraphNode *CGN) {
-  WriteToOutput(CGN, o); return o;
-}
-
 #endif