Provide support for HP/UX aCC compiler's variant of hash_map and hash_set
[oota-llvm.git] / include / llvm / Function.h
index b363191b93cdb79146891cabf4a0f71ccc4311ba..a4545a79ab1404813aa587acacd831c067b347d8 100644 (file)
@@ -21,7 +21,7 @@
 #include "llvm/GlobalValue.h"
 #include "llvm/BasicBlock.h"
 #include "llvm/Argument.h"
-#include "Support/Annotation.h"
+#include "llvm/Support/Annotation.h"
 
 namespace llvm {
 
@@ -90,6 +90,10 @@ public:
   const Type *getReturnType() const;           // Return the type of the ret val
   const FunctionType *getFunctionType() const; // Return the FunctionType for me
 
+  /// isVarArg - Return true if this function takes a variable number of
+  /// arguments.
+  bool isVarArg() const;
+
   /// isExternal - Is the body of this function unknown? (The basic block list
   /// is empty if so.) This is true for external functions, defined as forward
   /// "declare"ations
@@ -106,6 +110,13 @@ public:
   unsigned getIntrinsicID() const;
   bool isIntrinsic() const { return getIntrinsicID() != 0; }
 
+  /// renameLocalSymbols - This method goes through the Function's symbol table
+  /// and renames any symbols that conflict with symbols at global scope.  This
+  /// is required before printing out to a textual form, to ensure that there is
+  /// no ambiguity when parsing.
+  void renameLocalSymbols();
+
+
   /// deleteBody - This method deletes the body of the function, and converts
   /// the linkage to external.
   ///
@@ -114,6 +125,17 @@ public:
     setLinkage(ExternalLinkage);
   }
 
+  /// removeFromParent - This method unlinks 'this' from the containing module,
+  /// but does not delete it.
+  ///
+  void removeFromParent();
+
+  /// eraseFromParent - This method unlinks 'this' from the containing module
+  /// and deletes it.
+  ///
+  void eraseFromParent();
+
+
   // 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.
@@ -157,12 +179,12 @@ public:
   reverse_iterator       rend  ()       { return BasicBlocks.rend();   }
   const_reverse_iterator rend  () const { return BasicBlocks.rend();   }
 
-  unsigned                 size() const { return BasicBlocks.size(); }
+  size_t                   size() const { return BasicBlocks.size();  }
   bool                    empty() const { return BasicBlocks.empty(); }
   const BasicBlock       &front() const { return BasicBlocks.front(); }
         BasicBlock       &front()       { return BasicBlocks.front(); }
-  const BasicBlock        &back() const { return BasicBlocks.back(); }
-        BasicBlock        &back()       { return BasicBlocks.back(); }
+  const BasicBlock        &back() const { return BasicBlocks.back();  }
+        BasicBlock        &back()       { return BasicBlocks.back();  }
 
   //===--------------------------------------------------------------------===//
   // Argument iterator forwarding functions
@@ -177,12 +199,12 @@ public:
   reverse_aiterator       arend  ()       { return ArgumentList.rend();   }
   const_reverse_aiterator arend  () const { return ArgumentList.rend();   }
 
-  unsigned                  asize() const { return ArgumentList.size(); }
+  size_t                    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(); }
+  const Argument           &aback() const { return ArgumentList.back();  }
+        Argument           &aback()       { return ArgumentList.back();  }
 
   virtual void print(std::ostream &OS) const { print(OS, 0); }
   void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const;