[llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp

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



Changes in directory llvm/lib/Target/CBackend:

CBackend.cpp updated: 1.310 -> 1.311
---
Log message:

Rename BoolTy as Int1Ty. Patch by Sheng Zhou.


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

 CBackend.cpp |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)


Index: llvm/lib/Target/CBackend/CBackend.cpp
diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.310 llvm/lib/Target/CBackend/CBackend.cpp:1.311
--- llvm/lib/Target/CBackend/CBackend.cpp:1.310	Thu Jan 11 06:24:14 2007
+++ llvm/lib/Target/CBackend/CBackend.cpp	Thu Jan 11 12:21:29 2007
@@ -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 ||






More information about the llvm-commits mailing list