Change UsedPhysRegs from array bool to BitVector to save some space. Setting / gettin...
[oota-llvm.git] / include / llvm / Function.h
index 594b6efdc2ba63a0d5da1123eae1d7010e805f09..c0984f636789daafe505cfe0681560b9e243ffcc 100644 (file)
@@ -128,7 +128,7 @@ public:
   /// Sets the parameter attributes for this Function. To construct a 
   /// ParamAttrsList, see ParameterAttributes.h
   /// @brief Set the parameter attributes.
-  void setParamAttrs(ParamAttrsList *attrs) { ParamAttrs = attrs; }
+  void setParamAttrs(ParamAttrsList *attrs);
 
   /// deleteBody - This method deletes the body of the function, and converts
   /// the linkage to external.
@@ -141,23 +141,14 @@ public:
   /// removeFromParent - This method unlinks 'this' from the containing module,
   /// but does not delete it.
   ///
-  void removeFromParent();
+  virtual void removeFromParent();
 
   /// eraseFromParent - This method unlinks 'this' from the containing module
   /// and deletes it.
   ///
-  void eraseFromParent();
+  virtual 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.
-  //
-        Function *getNext()       { return Next; }
-  const Function *getNext() const { return Next; }
-        Function *getPrev()       { return Prev; }
-  const Function *getPrev() const { return Prev; }
-
   /// Get the underlying elements of the Function... the basic block list is
   /// empty for external functions.
   ///
@@ -246,12 +237,21 @@ public:
   
   static unsigned getBasicBlockListOffset() {
     Function *Obj = 0;
-    return reinterpret_cast<unsigned>(&Obj->BasicBlocks);
+    return unsigned(reinterpret_cast<uintptr_t>(&Obj->BasicBlocks));
   }
   static unsigned getArgumentListOffset() {
     Function *Obj = 0;
-    return reinterpret_cast<unsigned>(&Obj->ArgumentList);
+    return unsigned(reinterpret_cast<uintptr_t>(&Obj->ArgumentList));
   }
+private:
+  // 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; }
+  const Function *getPrev() const { return Prev; }
 };
 
 inline ValueSymbolTable *