[llvm-commits] CVS: llvm/include/llvm/Constants.h Intrinsics.td Type.h

Reid Spencer reid at x10sys.com
Thu Jan 11 10:22:15 PST 2007



Changes in directory llvm/include/llvm:

Constants.h updated: 1.115 -> 1.116
Intrinsics.td updated: 1.38 -> 1.39
Type.h updated: 1.97 -> 1.98
---
Log message:

Rename BoolTy as Int1Ty. Patch by Sheng Zhou.


---
Diffs of the changes:  (+12 -12)

 Constants.h   |   10 +++++-----
 Intrinsics.td |    2 +-
 Type.h        |   12 ++++++------
 3 files changed, 12 insertions(+), 12 deletions(-)


Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.115 llvm/include/llvm/Constants.h:1.116
--- llvm/include/llvm/Constants.h:1.115	Thu Jan 11 08:31:10 2007
+++ llvm/include/llvm/Constants.h	Thu Jan 11 12:21:28 2007
@@ -102,13 +102,13 @@
     static ConstantInt *CI = 0;
     if (CI) return CI; 
     return CI = new ConstantInt(getType(), 
-                                Val ^ (getType() == Type::BoolTy ? 1 : -1));
+                                Val ^ (getType() == Type::Int1Ty ? 1 : -1));
   }
 
   /// @returns the value of this ConstantInt only if it's a boolean type.
   /// @brief return the boolean value of this constant.
   inline bool getBoolValue() const { 
-    assert(getType() == Type::BoolTy && "Should be a boolean constant!");
+    assert(getType() == Type::Int1Ty && "Should be a boolean constant!");
     return static_cast<bool>(getZExtValue()); 
   }
 
@@ -137,7 +137,7 @@
   /// @returns true iff this constant's bits are all set to true.
   /// @brief Determine if the value is all ones.
   virtual bool isAllOnesValue() const { 
-    if (getType() == Type::BoolTy) return getBoolValue() == true;
+    if (getType() == Type::Int1Ty) return getBoolValue() == true;
     return getSExtValue() == -1; 
   }
 
@@ -147,7 +147,7 @@
   /// by this type.
   /// @brief Determine if the value is maximal.
   virtual bool isMaxValue(bool isSigned) const {
-    if (getType() == Type::BoolTy) return getBoolValue() == true;
+    if (getType() == Type::Int1Ty) return getBoolValue() == true;
     if (isSigned) {
       int64_t V = getSExtValue();
       if (V < 0) return false;    // Be careful about wrap-around on 'long's
@@ -163,7 +163,7 @@
   /// this type.
   /// @brief Determine if the value is minimal.
   virtual bool isMinValue(bool isSigned) const {
-    if (getType() == Type::BoolTy) return getBoolValue() == false;
+    if (getType() == Type::Int1Ty) return getBoolValue() == false;
     if (isSigned) {
       int64_t V = getSExtValue();
       if (V > 0) return false;    // Be careful about wrap-around on 'long's


Index: llvm/include/llvm/Intrinsics.td
diff -u llvm/include/llvm/Intrinsics.td:1.38 llvm/include/llvm/Intrinsics.td:1.39
--- llvm/include/llvm/Intrinsics.td:1.38	Sun Jan  7 02:52:43 2007
+++ llvm/include/llvm/Intrinsics.td	Thu Jan 11 12:21:28 2007
@@ -64,7 +64,7 @@
 } 
 
 def llvm_void_ty       : LLVMType<isVoid, "Type::VoidTyID">;
-def llvm_bool_ty       : LLVMType<i1 , "Type::BoolTyID">;
+def llvm_i1_ty         : LLVMType<i1 , "Type::Int1TyID">;
 def llvm_i8_ty         : LLVMType<i8 , "Type::Int8TyID">;
 def llvm_i16_ty        : LLVMType<i16, "Type::Int16TyID">;
 def llvm_i32_ty        : LLVMType<i32, "Type::Int32TyID">;


Index: llvm/include/llvm/Type.h
diff -u llvm/include/llvm/Type.h:1.97 llvm/include/llvm/Type.h:1.98
--- llvm/include/llvm/Type.h:1.97	Sat Dec 30 23:20:51 2006
+++ llvm/include/llvm/Type.h	Thu Jan 11 12:21:28 2007
@@ -71,7 +71,7 @@
   ///
   enum TypeID {
     // PrimitiveTypes .. make sure LastPrimitiveTyID stays up to date
-    VoidTyID = 0  , BoolTyID,           //  0, 1: Basics...
+    VoidTyID = 0  , Int1TyID,           //  0, 1: Basics...
     Int8TyID,                           //  2   :  8 bit type...
     Int16TyID,                          //  3   : 16 bit type...
     Int32TyID,                          //  4   : 32 bit type...
@@ -165,9 +165,9 @@
   bool isInteger() const { return ID >= Int8TyID && ID <= Int64TyID; }
 
   /// isIntegral - Returns true if this is an integral type, which is either
-  /// BoolTy or one of the Integer types.
+  /// Int1Ty or one of the Integer types.
   ///
-  bool isIntegral() const { return isInteger() || this == BoolTy; }
+  bool isIntegral() const { return isInteger() || this == Int1Ty; }
 
   /// isFloatingPoint - Return true if this is one of the two floating point
   /// types
@@ -209,7 +209,7 @@
   ///
   bool isSized() const {
     // If it's a primitive, it is always sized.
-    if (ID >= BoolTyID && ID <= DoubleTyID || ID == PointerTyID)
+    if (ID >= Int1TyID && ID <= DoubleTyID || ID == PointerTyID)
       return true;
     // If it is not something that can have a size (e.g. a function or label),
     // it doesn't have a size.
@@ -248,7 +248,7 @@
   /// will be promoted to if passed through a variable argument
   /// function.
   const Type *getVAArgsPromotedType() const {
-    if (ID == BoolTyID || ID == Int8TyID || ID == Int16TyID)
+    if (ID == Int1TyID || ID == Int8TyID || ID == Int16TyID)
       return Type::Int32Ty;
     else if (ID == FloatTyID)
       return Type::DoubleTy;
@@ -288,7 +288,7 @@
   //===--------------------------------------------------------------------===//
   // These are the builtin types that are always available...
   //
-  static Type *VoidTy , *BoolTy;
+  static Type *VoidTy , *Int1Ty;
   static Type *Int8Ty , *Int16Ty,
               *Int32Ty, *Int64Ty;
   static Type *FloatTy, *DoubleTy;






More information about the llvm-commits mailing list