aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CBackend/CBackend.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-02 08:14:45 +0000
committerChris Lattner <sabre@nondot.org>2008-03-02 08:14:45 +0000
commitd9a706ecf923b96259f9a708ec9830b047bda6c9 (patch)
tree75da8302edb91b7376e3bc994426e47d9c578a74 /lib/Target/CBackend/CBackend.cpp
parent9152daf868f82562f89e1bff58e307e31a92f4d0 (diff)
fix printing of undef vectors, this fixes "simple" and "build" in UnitTests/Vector.
Now they all pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47820 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CBackend/CBackend.cpp')
-rw-r--r--lib/Target/CBackend/CBackend.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 12711c5ea3..ba3785a0d5 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -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;
}