I forgot that sparc no longer uses the shared asmwriter. Give it support
authorChris Lattner <sabre@nondot.org>
Sun, 17 Oct 2004 02:44:45 +0000 (02:44 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 17 Oct 2004 02:44:45 +0000 (02:44 +0000)
for undef.

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

lib/Target/SparcV9/SparcV9AsmPrinter.cpp

index 1c0d1c000ad1320ef4a1e107341666344e9c4604..8000a014fc9b41a2562c970be059a1174153f5cb 100644 (file)
@@ -323,7 +323,9 @@ void AsmPrinter::printSingleConstantValue(const Constant* CV) {
     O << ConstantExprToString(CE, TM) << "\n";
   } else if (CV->getType()->isPrimitiveType()) {
     // Check primitive types last
-    if (CV->getType()->isFloatingPoint()) {
+    if (isa<UndefValue>(CV)) {
+      O << "0\n";
+    } else if (CV->getType()->isFloatingPoint()) {
       // FP Constants are printed as integer constants to avoid losing
       // precision...
       double Val = cast<ConstantFP>(CV)->getValue();
@@ -385,7 +387,7 @@ void AsmPrinter::printConstantValueOnly(const Constant* CV,
     }
     assert(sizeSoFar == cvsLayout->StructSize &&
            "Layout of constant struct may be incorrect!");
-  } else if (isa<ConstantAggregateZero>(CV)) {
+  } else if (isa<ConstantAggregateZero>(CV) || isa<UndefValue>(CV)) {
     PrintZeroBytesToPad(TM.getTargetData().getTypeSize(CV->getType()));
   } else
     printSingleConstantValue(CV);