aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--lib/CodeGen/CGExprScalar.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index 9af269eaf3..2e2eea3e31 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -154,7 +154,9 @@ public:
Value *VisitShuffleVectorExpr(ShuffleVectorExpr *E);
Value *VisitMemberExpr(Expr *E) { return EmitLoadOfLValue(E); }
Value *VisitExtVectorElementExpr(Expr *E) { return EmitLoadOfLValue(E); }
- Value *VisitCompoundLiteralExpr(CompoundLiteralExpr *E) { return EmitLoadOfLValue(E); }
+ Value *VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
+ return EmitLoadOfLValue(E);
+ }
Value *VisitStringLiteral(Expr *E) { return EmitLValue(E).getAddress(); }
Value *VisitPredefinedExpr(Expr *E) { return EmitLValue(E).getAddress(); }
@@ -168,6 +170,11 @@ public:
if (!VType)
return Visit(E->getInit(0));
+ if (E->hadDesignators()) {
+ CGF.ErrorUnsupported(E, "initializer list with designators");
+ return llvm::UndefValue::get(CGF.ConvertType(E->getType()));
+ }
+
unsigned NumVectorElements = VType->getNumElements();
const llvm::Type *ElementType = VType->getElementType();