Type: replaced usage of ID with getTypeID().
[oota-llvm.git] / include / llvm / Type.h
index 716751a94e2522ff6da6961a8638d59ff118ba88..8b859c5448045002be38cd2352a127b32ad0ac9d 100644 (file)
@@ -120,49 +120,51 @@ public:
   TypeID getTypeID() const { return ID; }
 
   /// isVoidTy - Return true if this is 'void'.
-  bool isVoidTy() const { return ID == VoidTyID; }
+  bool isVoidTy() const { return getTypeID() == VoidTyID; }
 
   /// isHalfTy - Return true if this is 'half', a 16-bit IEEE fp type.
-  bool isHalfTy() const { return ID == HalfTyID; }
+  bool isHalfTy() const { return getTypeID() == HalfTyID; }
 
   /// isFloatTy - Return true if this is 'float', a 32-bit IEEE fp type.
-  bool isFloatTy() const { return ID == FloatTyID; }
+  bool isFloatTy() const { return getTypeID() == FloatTyID; }
   
   /// isDoubleTy - Return true if this is 'double', a 64-bit IEEE fp type.
-  bool isDoubleTy() const { return ID == DoubleTyID; }
+  bool isDoubleTy() const { return getTypeID() == DoubleTyID; }
 
   /// isX86_FP80Ty - Return true if this is x86 long double.
-  bool isX86_FP80Ty() const { return ID == X86_FP80TyID; }
+  bool isX86_FP80Ty() const { return getTypeID() == X86_FP80TyID; }
 
   /// isFP128Ty - Return true if this is 'fp128'.
-  bool isFP128Ty() const { return ID == FP128TyID; }
+  bool isFP128Ty() const { return getTypeID() == FP128TyID; }
 
   /// isPPC_FP128Ty - Return true if this is powerpc long double.
-  bool isPPC_FP128Ty() const { return ID == PPC_FP128TyID; }
+  bool isPPC_FP128Ty() const { return getTypeID() == PPC_FP128TyID; }
 
   /// isFloatingPointTy - Return true if this is one of the five floating point
   /// types
   bool isFloatingPointTy() const {
-    return ID == HalfTyID || ID == FloatTyID || ID == DoubleTyID ||
-      ID == X86_FP80TyID || ID == FP128TyID || ID == PPC_FP128TyID;
+    return getTypeID() == HalfTyID || getTypeID() == FloatTyID ||
+           getTypeID() == DoubleTyID ||
+           getTypeID() == X86_FP80TyID || getTypeID() == FP128TyID ||
+           getTypeID() == PPC_FP128TyID;
   }
 
   /// isX86_MMXTy - Return true if this is X86 MMX.
-  bool isX86_MMXTy() const { return ID == X86_MMXTyID; }
+  bool isX86_MMXTy() const { return getTypeID() == X86_MMXTyID; }
 
   /// isFPOrFPVectorTy - Return true if this is a FP type or a vector of FP.
   ///
   bool isFPOrFPVectorTy() const;
  
   /// isLabelTy - Return true if this is 'label'.
-  bool isLabelTy() const { return ID == LabelTyID; }
+  bool isLabelTy() const { return getTypeID() == LabelTyID; }
 
   /// isMetadataTy - Return true if this is 'metadata'.
-  bool isMetadataTy() const { return ID == MetadataTyID; }
+  bool isMetadataTy() const { return getTypeID() == MetadataTyID; }
 
   /// isIntegerTy - True if this is an instance of IntegerType.
   ///
-  bool isIntegerTy() const { return ID == IntegerTyID; } 
+  bool isIntegerTy() const { return getTypeID() == IntegerTyID; } 
 
   /// isIntegerTy - Return true if this is an IntegerType of the given width.
   bool isIntegerTy(unsigned Bitwidth) const;
@@ -174,23 +176,23 @@ public:
   
   /// isFunctionTy - True if this is an instance of FunctionType.
   ///
-  bool isFunctionTy() const { return ID == FunctionTyID; }
+  bool isFunctionTy() const { return getTypeID() == FunctionTyID; }
 
   /// isStructTy - True if this is an instance of StructType.
   ///
-  bool isStructTy() const { return ID == StructTyID; }
+  bool isStructTy() const { return getTypeID() == StructTyID; }
 
   /// isArrayTy - True if this is an instance of ArrayType.
   ///
-  bool isArrayTy() const { return ID == ArrayTyID; }
+  bool isArrayTy() const { return getTypeID() == ArrayTyID; }
 
   /// isPointerTy - True if this is an instance of PointerType.
   ///
-  bool isPointerTy() const { return ID == PointerTyID; }
+  bool isPointerTy() const { return getTypeID() == PointerTyID; }
 
   /// isVectorTy - True if this is an instance of VectorType.
   ///
-  bool isVectorTy() const { return ID == VectorTyID; }
+  bool isVectorTy() const { return getTypeID() == VectorTyID; }
 
   /// canLosslesslyBitCastTo - Return true if this type could be converted 
   /// with a lossless BitCast to type 'Ty'. For example, i8* to i32*. BitCasts 
@@ -206,14 +208,14 @@ public:
   /// Here are some useful little methods to query what type derived types are
   /// Note that all other types can just compare to see if this == Type::xxxTy;
   ///
-  bool isPrimitiveType() const { return ID <= LastPrimitiveTyID; }
-  bool isDerivedType()   const { return ID >= FirstDerivedTyID; }
+  bool isPrimitiveType() const { return getTypeID() <= LastPrimitiveTyID; }
+  bool isDerivedType()   const { return getTypeID() >= FirstDerivedTyID; }
 
   /// isFirstClassType - Return true if the type is "first class", meaning it
   /// is a valid type for a Value.
   ///
   bool isFirstClassType() const {
-    return ID != FunctionTyID && ID != VoidTyID;
+    return getTypeID() != FunctionTyID && getTypeID() != VoidTyID;
   }
 
   /// isSingleValueType - Return true if the type is a valid type for a
@@ -221,8 +223,9 @@ public:
   /// and array types.
   ///
   bool isSingleValueType() const {
-    return (ID != VoidTyID && isPrimitiveType()) ||
-            ID == IntegerTyID || ID == PointerTyID || ID == VectorTyID;
+    return (getTypeID() != VoidTyID && isPrimitiveType()) ||
+            getTypeID() == IntegerTyID || getTypeID() == PointerTyID ||
+            getTypeID() == VectorTyID;
   }
 
   /// isAggregateType - Return true if the type is an aggregate type. This
@@ -231,7 +234,7 @@ public:
   /// does not include vector types.
   ///
   bool isAggregateType() const {
-    return ID == StructTyID || ID == ArrayTyID;
+    return getTypeID() == StructTyID || getTypeID() == ArrayTyID;
   }
 
   /// isSized - Return true if it makes sense to take the size of this type.  To
@@ -240,12 +243,14 @@ public:
   ///
   bool isSized() const {
     // If it's a primitive, it is always sized.
-    if (ID == IntegerTyID || isFloatingPointTy() || ID == PointerTyID ||
-        ID == X86_MMXTyID)
+    if (getTypeID() == IntegerTyID || isFloatingPointTy() ||
+        getTypeID() == PointerTyID ||
+        getTypeID() == X86_MMXTyID)
       return true;
     // If it is not something that can have a size (e.g. a function or label),
     // it doesn't have a size.
-    if (ID != StructTyID && ID != ArrayTyID && ID != VectorTyID)
+    if (getTypeID() != StructTyID && getTypeID() != ArrayTyID &&
+        getTypeID() != VectorTyID)
       return false;
     // Otherwise we have to try harder to decide.
     return isSizedDerivedType();