Rename BoolTy as Int1Ty. Patch by Sheng Zhou.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 9517134..f945036 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -369,7 +369,7 @@
   assert(Ty->isPrimitiveType() && "Invalid type for printPrimitiveType");
   switch (Ty->getTypeID()) {
   case Type::VoidTyID:   return Out << "void "               << NameSoFar;
-  case Type::BoolTyID:   return Out << "bool "               << NameSoFar;
+  case Type::Int1TyID:   return Out << "bool "               << NameSoFar;
   case Type::Int8TyID:
     return Out << (isSigned?"signed":"unsigned") << " char " << NameSoFar;
   case Type::Int16TyID:  
@@ -688,12 +688,12 @@
       Out << "(";
       printCast(CE->getOpcode(), CE->getOperand(0)->getType(), CE->getType());
       if (CE->getOpcode() == Instruction::SExt &&
-          CE->getOperand(0)->getType() == Type::BoolTy) {
+          CE->getOperand(0)->getType() == Type::Int1Ty) {
         // Make sure we really sext from bool here by subtracting from 0
         Out << "0-";
       }
       printConstant(CE->getOperand(0));
-      if (CE->getType() == Type::BoolTy &&
+      if (CE->getType() == Type::Int1Ty &&
           (CE->getOpcode() == Instruction::Trunc ||
            CE->getOpcode() == Instruction::FPToUI ||
            CE->getOpcode() == Instruction::FPToSI ||
@@ -828,7 +828,7 @@
 
   if (ConstantInt *CI = dyn_cast<ConstantInt>(CPV)) {
     const Type* Ty = CI->getType();
-    if (Ty == Type::BoolTy)
+    if (Ty == Type::Int1Ty)
       Out << (CI->getBoolValue() ? '1' : '0') ;
     else {
       Out << "((";
@@ -2256,12 +2256,12 @@
         << getFloatBitCastField(I.getType());
   } else {
     printCast(I.getOpcode(), SrcTy, DstTy);
-    if (I.getOpcode() == Instruction::SExt && SrcTy == Type::BoolTy) {
+    if (I.getOpcode() == Instruction::SExt && SrcTy == Type::Int1Ty) {
       // Make sure we really get a sext from bool by subtracing the bool from 0
       Out << "0-";
     }
     writeOperand(I.getOperand(0));
-    if (DstTy == Type::BoolTy && 
+    if (DstTy == Type::Int1Ty && 
         (I.getOpcode() == Instruction::Trunc ||
          I.getOpcode() == Instruction::FPToUI ||
          I.getOpcode() == Instruction::FPToSI ||
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index db0ea2c..59dc0dc 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -241,7 +241,7 @@
                                uint64_t &Size, unsigned char &Alignment) {
   assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!");
   switch (Ty->getTypeID()) {
-  case Type::BoolTyID:   Size = 1; Alignment = TD->getBoolAlignment(); return;
+  case Type::Int1TyID:   Size = 1; Alignment = TD->getBoolAlignment(); return;
   case Type::VoidTyID:
   case Type::Int8TyID:   Size = 1; Alignment = TD->getByteAlignment(); return;
   case Type::Int16TyID:  Size = 2; Alignment = TD->getShortAlignment(); return;