Add a portable strerror*() wrapper, llvm::sys::StrError(). This includes the
[oota-llvm.git] / include / llvm / Type.h
index 8c07b3e2a06982d9686bd06fa7f4bc1b8a361a43..d439233d8c05d1d643c50de1a26259b5db8c9a09 100644 (file)
@@ -103,7 +103,7 @@ private:
   /// has no AbstractTypeUsers, the type is deleted.  This is only sensical for
   /// derived types.
   ///
-  mutable uint32_t RefCount;
+  mutable sys::cas_flag RefCount;
 
   const Type *getForwardedTypeInternal() const;
 
@@ -338,7 +338,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 +347,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.
-    uint32_t Count = sys::AtomicDecrement32(&RefCount);
-    if (Count == 0 && AbstractTypeUsers.empty())
+    sys::cas_flag OldCount = sys::AtomicDecrement(&RefCount);
+    if (OldCount == 0 && AbstractTypeUsers.empty())
       this->destroy();
   }