diff options
author | Anders Carlsson <andersca@mac.com> | 2008-01-29 01:15:48 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2008-01-29 01:15:48 +0000 |
commit | f6884ac7cfc4c5562c0678ad65b3460a38f56e23 (patch) | |
tree | 6bf6cb0df06894c5a37b8c41027105fecddc0b64 /CodeGen/CGExprScalar.cpp | |
parent | ff6e3c596e38328447461894cb8fd3ae22f499c4 (diff) |
Correctly handle scalars in braces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CGExprScalar.cpp')
-rw-r--r-- | CodeGen/CGExprScalar.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CodeGen/CGExprScalar.cpp b/CodeGen/CGExprScalar.cpp index 8ec1a83318..652729ac27 100644 --- a/CodeGen/CGExprScalar.cpp +++ b/CodeGen/CGExprScalar.cpp @@ -130,7 +130,11 @@ public: unsigned NumInitElements = E->getNumInits(); const llvm::VectorType *VType = - cast<llvm::VectorType>(ConvertType(E->getType())); + dyn_cast<llvm::VectorType>(ConvertType(E->getType())); + + // We have a scalar in braces. Just use the first element. + if (!VType) + return Visit(E->getInit(0)); unsigned NumVectorElements = VType->getNumElements(); const llvm::Type *ElementType = VType->getElementType(); |