[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp

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



Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.10 -> 1.11
---
Log message:

Add support for undef


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

Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.10 llvm/lib/CodeGen/AsmPrinter.cpp:1.11
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.10	Mon Aug 23 19:26:11 2004
+++ llvm/lib/CodeGen/AsmPrinter.cpp	Sat Oct 16 13:19:08 2004
@@ -55,7 +55,7 @@
 // Print out the specified constant, without a storage class.  Only the
 // constants valid in constant expressions can occur here.
 void AsmPrinter::emitConstantValueOnly(const Constant *CV) {
-  if (CV->isNullValue())
+  if (CV->isNullValue() || isa<UndefValue>(CV))
     O << "0";
   else if (const ConstantBool *CB = dyn_cast<ConstantBool>(CV)) {
     assert(CB == ConstantBool::True);
@@ -171,7 +171,7 @@
 void AsmPrinter::emitGlobalConstant(const Constant *CV) {  
   const TargetData &TD = TM.getTargetData();
 
-  if (CV->isNullValue()) {
+  if (CV->isNullValue() || isa<UndefValue>(CV)) {
     emitZeros(TD.getTypeSize(CV->getType()));
     return;
   } else if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV)) {






More information about the llvm-commits mailing list