unbreak i1 constants with the cpp writer, eliminate special case.
authorChris Lattner <sabre@nondot.org>
Fri, 12 Jan 2007 18:37:29 +0000 (18:37 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 12 Jan 2007 18:37:29 +0000 (18:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33133 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm2cpp/CppWriter.cpp

index 82997cebcc5057b935802584663c8def9bffbeef..845fad47b02c10586db1637806559eaf4f9e2749 100644 (file)
@@ -666,12 +666,8 @@ void CppWriter::printConstant(const Constant *CV) {
     return;
   }
   if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
-    if (CI->getType() == Type::Int1Ty)
-      Out << "ConstantInt* " << constName << " = ConstantInt::get(" 
-          << (CI->getZExtValue() ? "true" : "false") << ");";
-    else
-      Out << "ConstantInt* " << constName << " = ConstantInt::get(" 
-          << typeName << ", " << CI->getZExtValue() << ");";
+    Out << "ConstantInt* " << constName << " = ConstantInt::get(" 
+        << typeName << ", " << CI->getZExtValue() << ");";
   } else if (isa<ConstantAggregateZero>(CV)) {
     Out << "ConstantAggregateZero* " << constName 
         << " = ConstantAggregateZero::get(" << typeName << ");";