fix printing of undef vectors, this fixes "simple" and "build" in UnitTests/Vector.
authorChris Lattner <sabre@nondot.org>
Sun, 2 Mar 2008 08:14:45 +0000 (08:14 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 2 Mar 2008 08:14:45 +0000 (08:14 +0000)
Now they all pass.

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

lib/Target/CBackend/CBackend.cpp

index 12711c5ea3d70d8ac07b4be9f8430f92c513c0f6..ba3785a0d5e5c98a6638d9fcddba7327ac381c15 100644 (file)
@@ -913,7 +913,12 @@ void CWriter::printConstant(Constant *CPV) {
   } else if (isa<UndefValue>(CPV) && CPV->getType()->isFirstClassType()) {
     Out << "((";
     printType(Out, CPV->getType()); // sign doesn't matter
-    Out << ")/*UNDEF*/0)";
+    Out << ")/*UNDEF*/";
+    if (!isa<VectorType>(CPV->getType())) {
+      Out << "0)";
+    } else {
+      Out << "{})";
+    }
     return;
   }