Fix PR228: [sparc] Boolean constants are emitted as true and false
authorChris Lattner <sabre@nondot.org>
Tue, 10 Feb 2004 05:16:44 +0000 (05:16 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 10 Feb 2004 05:16:44 +0000 (05:16 +0000)
I will observe that the concept of using WriteAsOperand is completely broken,
but then we all knew that, didn't we?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11255 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9AsmPrinter.cpp

index 863ffd7007a39d6f8d5a4fc93653c01d8789386e..277da698273b9828d6d18256ef8a7dce746bef9c 100644 (file)
@@ -340,6 +340,8 @@ void AsmPrinter::printSingleConstantValue(const Constant* CV) {
         
       toAsm << "\t! " << CV->getType()->getDescription()
             << " value: " << Val << "\n";
+    } else if (const ConstantBool *CB = dyn_cast<ConstantBool>(CV)) {
+      toAsm << (int)CB->getValue() << "\n";
     } else {
       WriteAsOperand(toAsm, CV, false, false) << "\n";
     }