Fix a thinko in a comment that Duncan spotted.
[oota-llvm.git] / include / llvm / Type.h
index 97d5043dc416e6b20ddebae5bd0abc57d56c7705..38c4e30539fb00d125a0028c26da70ad72c63b96 100644 (file)
@@ -103,7 +103,7 @@ private:
   /// has no AbstractTypeUsers, the type is deleted.  This is only sensical for
   /// derived types.
   ///
-  mutable int32_t RefCount;
+  mutable sys::cas_flag RefCount;
 
   const Type *getForwardedTypeInternal() const;
 
@@ -191,7 +191,7 @@ public:
   ///
   bool isIntOrIntVector() const;
   
-  /// isFloatingPoint - Return true if this is one of the two floating point
+  /// isFloatingPoint - Return true if this is one of the five floating point
   /// types
   bool isFloatingPoint() const { return ID == FloatTyID || ID == DoubleTyID ||
       ID == X86_FP80TyID || ID == FP128TyID || ID == PPC_FP128TyID; }
@@ -268,6 +268,11 @@ public:
   /// This will return zero if the type does not have a size or is not a
   /// primitive type.
   ///
+  /// Note that this may not reflect the size of memory allocated for an
+  /// instance of the type or the number of bytes that are written when an
+  /// instance of the type is stored to memory. The TargetData class provides
+  /// additional query functions to provide this information.
+  ///
   unsigned getPrimitiveSizeInBits() const;
 
   /// getScalarSizeInBits - If this is a vector type, return the
@@ -338,7 +343,7 @@ public:
 
   void addRef() const {
     assert(isAbstract() && "Cannot add a reference to a non-abstract type!");
-    sys::AtomicIncrement32(&RefCount);
+    sys::AtomicIncrement(&RefCount);
   }
 
   void dropRef() const {
@@ -347,8 +352,8 @@ public:
 
     // If this is the last PATypeHolder using this object, and there are no
     // PATypeHandles using it, the type is dead, delete it now.
-    int32_t Count = sys::AtomicDecrement32(&RefCount);
-    if (Count == 0 && AbstractTypeUsers.empty())
+    sys::cas_flag OldCount = sys::AtomicDecrement(&RefCount);
+    if (OldCount == 0 && AbstractTypeUsers.empty())
       this->destroy();
   }