Add an extra operand to LABEL nodes which distinguishes between debug, EH, or misc...
[oota-llvm.git] / include / llvm / Function.h
index 56ed5c26f0be8e2a8dc3c92a785467eaa98818b6..2c4f9d9e27dea5c85e0d4c203cccb5e876a6bee7 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     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 file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -68,7 +68,7 @@ private:
   BasicBlockListType  BasicBlocks;        ///< The basic blocks
   mutable ArgumentListType ArgumentList;  ///< The formal arguments
   ValueSymbolTable *SymTab;               ///< Symbol table of args/instructions
-  ParamAttrsList *ParamAttrs;             ///< Parameter attributes
+  const ParamAttrsList *ParamAttrs;       ///< Parameter attributes
   
   // The Calling Convention is stored in Value::SubclassData.
   /*unsigned CallingConvention;*/
@@ -101,6 +101,9 @@ private:
       BuildLazyArguments();
   }
   void BuildLazyArguments() const;
+  
+  Function(const Function&); // DO NOT IMPLEMENT
+  void operator=(const Function&); // DO NOT IMPLEMENT
 public:
   /// Function ctor - If the (optional) Module argument is specified, the
   /// function is automatically inserted into the end of the function list for
@@ -150,7 +153,32 @@ public:
   /// Sets the parameter attributes for this Function. To construct a 
   /// ParamAttrsList, see ParameterAttributes.h
   /// @brief Set the parameter attributes.
-  void setParamAttrs(ParamAttrsList *attrs);
+  void setParamAttrs(const ParamAttrsList *attrs);
+
+  /// hasCollector/getCollector/setCollector/clearCollector - The name of the
+  /// garbage collection algorithm to use during code generation.
+  bool hasCollector() const;
+  const char *getCollector() const;
+  void setCollector(const char *Str);
+  void clearCollector();
+
+  /// @brief Determine whether the function has the given attribute.
+  bool paramHasAttr(uint16_t i, unsigned attr) const;
+  
+  /// @brief Determine if the function cannot return.
+  bool doesNotReturn() const;
+
+  /// @brief Determine if the function cannot unwind.
+  bool doesNotThrow() const;
+
+  /// @brief Determine if the function does not access memory.
+  bool doesNotAccessMemory() const;
+
+  /// @brief Determine if the function does not access or only reads memory.
+  bool onlyReadsMemory() const;
+
+  /// @brief Determine if the function returns a structure.
+  bool isStructReturn() const;
 
   /// deleteBody - This method deletes the body of the function, and converts
   /// the linkage to external.