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

Chris Lattner lattner at cs.uiuc.edu
Sat Oct 16 19:44:58 PDT 2004



Changes in directory llvm/lib/Target/SparcV9:

SparcV9AsmPrinter.cpp updated: 1.123 -> 1.124
---
Log message:

I forgot that sparc no longer uses the shared asmwriter.  Give it support
for undef.


---
Diffs of the changes:  (+4 -2)

Index: llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
diff -u llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.123 llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.124
--- llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.123	Sat Oct 16 13:14:09 2004
+++ llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp	Sat Oct 16 21:44:45 2004
@@ -323,7 +323,9 @@
     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 @@
     }
     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);






More information about the llvm-commits mailing list