Restore dump() methods to Loop and MachineLoop.
[oota-llvm.git] / include / llvm / Type.h
index 4a470af9ca5b0f3f534d866e9df63e0c582bf581..2c37a6890e903d08d45d4abea787cb659a3ff6b3 100644 (file)
@@ -7,15 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-
 #ifndef LLVM_TYPE_H
 #define LLVM_TYPE_H
 
 #include "llvm/AbstractTypeUser.h"
-#include "llvm/LLVMContext.h"
 #include "llvm/Support/Casting.h"
-#include "llvm/Support/DataTypes.h"
-#include "llvm/System/Atomic.h"
+#include "llvm/System/DataTypes.h"
 #include "llvm/ADT/GraphTraits.h"
 #include <string>
 #include <vector>
@@ -28,6 +25,7 @@ class IntegerType;
 class TypeMapBase;
 class raw_ostream;
 class Module;
+class LLVMContext;
 
 /// This file contains the declaration of the Type class.  For more "Type" type
 /// stuff, look in DerivedTypes.h.
@@ -104,7 +102,7 @@ private:
   /// has no AbstractTypeUsers, the type is deleted.  This is only sensical for
   /// derived types.
   ///
-  mutable sys::cas_flag RefCount;
+  mutable unsigned RefCount;
 
   /// Context - This refers to the LLVMContext in which this type was uniqued.
   LLVMContext &Context;
@@ -219,6 +217,9 @@ public:
   ///
   bool isInteger() const { return ID == IntegerTyID; } 
 
+  /// isInteger - Return true if this is an IntegerType of the specified width.
+  bool isInteger(unsigned Bitwidth) const;
+
   /// isIntOrIntVector - Return true if this is an integer type or a vector of
   /// integer types.
   ///
@@ -401,7 +402,7 @@ public:
 
   void addRef() const {
     assert(isAbstract() && "Cannot add a reference to a non-abstract type!");
-    sys::AtomicIncrement(&RefCount);
+    ++RefCount;
   }
 
   void dropRef() const {
@@ -410,8 +411,7 @@ public:
 
     // If this is the last PATypeHolder using this object, and there are no
     // PATypeHandles using it, the type is dead, delete it now.
-    sys::cas_flag OldCount = sys::AtomicDecrement(&RefCount);
-    if (OldCount == 0 && AbstractTypeUsers.empty())
+    if (--RefCount == 0 && AbstractTypeUsers.empty())
       this->destroy();
   }