Make comments above APIs reflect what they should do.
[oota-llvm.git] / include / llvm / Analysis / CallGraph.h
index fde7c82abbe72a791da69dfe5ee37f5a31a4e711..60649f9ed9d2ae97b151a03bdf949dc755e2eb7e 100644 (file)
@@ -1,4 +1,11 @@
-//===- CallGraph.h - Build a Module's call graph -----------------*- C++ -*--=//
+//===- CallGraph.h - Build a Module's call graph ----------------*- C++ -*-===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
 //
 // This interface is used to build and manipulate a call graph, which is a very 
 // useful tool for interprocedural optimization.
@@ -44,6 +51,9 @@
 #include "Support/GraphTraits.h"
 #include "Support/STLExtras.h"
 #include "llvm/Pass.h"
+
+namespace llvm {
+
 class Function;
 class Module;
 class CallGraphNode;
@@ -104,7 +114,7 @@ public:
   // Functions to keep a call graph up to date with a function that has been
   // modified
   //
-  void addFunctionToModule(Function *Meth);
+  void addFunctionToModule(Function *F);
 
 
   // removeFunctionFromModule - Unlink the function from this module, returning
@@ -114,8 +124,8 @@ public:
   // is to dropAllReferences before calling this.
   //
   Function *removeFunctionFromModule(CallGraphNode *CGN);
-  Function *removeFunctionFromModule(Function *Meth) {
-    return removeFunctionFromModule((*this)[Meth]);
+  Function *removeFunctionFromModule(Function *F) {
+    return removeFunctionFromModule((*this)[F]);
   }
 
 
@@ -144,6 +154,8 @@ public:
   ///
   void print(std::ostream &o, const Module *M) const;
 
+  // stub - dummy function, just ignore it
+  static void stub();
 private:
   //===---------------------------------------------------------------------
   // Implementation of CallGraph construction
@@ -168,7 +180,7 @@ private:
 // CallGraphNode class definition
 //
 class CallGraphNode {
-  Function *Meth;
+  Function *F;
   std::vector<CallGraphNode*> CalledFunctions;
 
   CallGraphNode(const CallGraphNode &);           // Do not implement
@@ -181,7 +193,7 @@ public:
   typedef std::vector<CallGraphNode*>::const_iterator const_iterator;
 
   // getFunction - Return the function that this call graph node represents...
-  Function *getFunction() const { return Meth; }
+  Function *getFunction() const { return F; }
 
   inline iterator begin() { return CalledFunctions.begin(); }
   inline iterator end()   { return CalledFunctions.end();   }
@@ -207,7 +219,7 @@ private:                    // Stuff to construct the node, used by CallGraph
   friend class CallGraph;
 
   // CallGraphNode ctor - Create a node for the specified function...
-  inline CallGraphNode(Function *F) : Meth(F) {}
+  inline CallGraphNode(Function *f) : F(f) {}
   
   // addCalledFunction add a function to the list of functions called by this
   // one
@@ -275,4 +287,10 @@ template<> struct GraphTraits<const CallGraph*> :
   static nodes_iterator nodes_end  (const CallGraph *CG) { return CG->end(); }
 };
 
+// Make sure that any clients of this file link in PostDominators.cpp
+static IncludeFile
+CALLGRAPH_INCLUDE_FILE((void*)&CallGraph::stub);
+
+} // End llvm namespace
+
 #endif