* Clean up indentation a bit
authorChris Lattner <sabre@nondot.org>
Fri, 6 Sep 2002 20:47:31 +0000 (20:47 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 6 Sep 2002 20:47:31 +0000 (20:47 +0000)
* Fix broken comments (copy and pasto)
* Remove irrelevant comment
* Add extra argument to function that causes it to get inserted into a module
  automatically.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3601 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Function.h

index 81dcf825127bb0e060f6129bd5f4127f4853947c..5976745c3e6192f19f3c3b2407b29251a4b285bd 100644 (file)
@@ -1,11 +1,10 @@
-//===-- llvm/Function.h - Class to represent a single VM function -*- C++ -*-=//
+//===-- llvm/Function.h - Class to represent a single function --*- C++ -*-===//
 //
 // This file contains the declaration of the Function class, which represents a 
-// single function/procedure in the VM.
+// single function/procedure in LLVM.
 //
-// Note that BasicBlock's in the Function are Value's, because they are
-// referenced by instructions like calls and can go into virtual function tables
-// and stuff.
+// A function basically consists of a list of basic blocks, a list of arguments,
+// and a symbol table.
 //
 //===----------------------------------------------------------------------===//
 
@@ -55,7 +54,7 @@ public:
 private:
 
   // Important things that make up a function!
-  BasicBlockListType  BasicBlocks;         // The basic blocks
+  BasicBlockListType  BasicBlocks;      // The basic blocks
   ArgumentListType ArgumentList;        // The formal arguments
 
   SymbolTable *SymTab, *ParentSymTab;
@@ -68,7 +67,12 @@ private:
   void setPrev(Function *N) { Prev = N; }
 
 public:
-  Function(const FunctionType *Ty, bool isInternal, const std::string &N = "");
+  /// Function ctor - If the (optional) Module argument is specified, the
+  /// function is automatically inserted into the end of the function list for
+  /// the module.
+  ///
+  Function(const FunctionType *Ty, bool isInternal, const std::string &N = "",
+           Module *M = 0);
   ~Function();
 
   // Specialize setName to handle symbol table majik...
@@ -83,8 +87,10 @@ public:
   ///
   bool isExternal() const { return BasicBlocks.empty(); }
 
-  // getNext/Prev - Return the next or previous instruction in the list.  The
-  // last node in the list is a terminator instruction.
+  // getNext/Prev - Return the next or previous function in the list.  These
+  // methods should never be used directly, and are only used to implement the
+  // function list as part of the module.
+  //
         Function *getNext()       { return Next; }
   const Function *getNext() const { return Next; }
         Function *getPrev()       { return Prev; }
@@ -156,12 +162,12 @@ public:
   reverse_aiterator       arend  ()       { return ArgumentList.rend();   }
   const_reverse_aiterator arend  () const { return ArgumentList.rend();   }
 
-  unsigned                 asize() const { return ArgumentList.size(); }
-  bool                    aempty() const { return ArgumentList.empty(); }
-  const Argument       &afront() const { return ArgumentList.front(); }
-        Argument       &afront()       { return ArgumentList.front(); }
-  const Argument        &aback() const { return ArgumentList.back(); }
-        Argument        &aback()       { return ArgumentList.back(); }
+  unsigned                  asize() const { return ArgumentList.size(); }
+  bool                     aempty() const { return ArgumentList.empty(); }
+  const Argument          &afront() const { return ArgumentList.front(); }
+        Argument          &afront()       { return ArgumentList.front(); }
+  const Argument           &aback() const { return ArgumentList.back(); }
+        Argument           &aback()       { return ArgumentList.back(); }
 
   virtual void print(std::ostream &OS) const;