#include "llvm/Pass.h"
class Method;
class Module;
-
class CallGraph;
+
+//===----------------------------------------------------------------------===//
+// CallGraphNode class definition
+//
class CallGraphNode {
Method *Meth;
std::vector<CallGraphNode*> CalledMethods;
};
+//===----------------------------------------------------------------------===//
+// CallGraph class definition
+//
class CallGraph : public Pass {
Module *Mod; // The module this call graph represents
};
-
+//===----------------------------------------------------------------------===//
+// 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.
};
-// 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
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