Unbreak VC++ build.
[oota-llvm.git] / include / llvm / Function.h
index 3fdbd02500817c74bd652048090b6a4b2cfc3f57..b3b9716d4dfdd741d1a2ffe00158b17db5168fab 100644 (file)
@@ -69,7 +69,10 @@ private:
   ArgumentListType ArgumentList;     ///< The formal arguments
   ValueSymbolTable *SymTab;          ///< Symbol table of args/instructions
   ParamAttrsList *ParamAttrs;        ///< Parameter attributes
-  unsigned CallingConvention;        ///< Calling convention to use
+
+  
+  // The Calling Convention is stored in Value::SubclassData.
+  /*unsigned CallingConvention;*/
 
   friend class SymbolTableListTraits<Function, Module>;
 
@@ -78,6 +81,15 @@ private:
   void setNext(Function *N) { Next = N; }
   void setPrev(Function *N) { Prev = N; }
 
+  // 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; }
+
 public:
   /// Function ctor - If the (optional) Module argument is specified, the
   /// function is automatically inserted into the end of the function list for
@@ -113,8 +125,8 @@ public:
   /// getCallingConv()/setCallingConv(uint) - These method get and set the
   /// calling convention of this function.  The enum values for the known
   /// calling conventions are defined in CallingConv.h.
-  unsigned getCallingConv() const { return CallingConvention; }
-  void setCallingConv(unsigned CC) { CallingConvention = CC; }
+  unsigned getCallingConv() const { return SubclassData; }
+  void setCallingConv(unsigned CC) { SubclassData = CC; }
 
   /// Obtains a constant pointer to the ParamAttrsList object which holds the
   /// parameter attributes information, if any. 
@@ -125,7 +137,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.
@@ -146,15 +158,6 @@ public:
   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.
   ///
@@ -243,11 +246,11 @@ 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));
   }
 };