aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-06-07 18:15:55 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-06-07 18:15:55 +0000
commitec22f56f2031c3e61100d42133b06f9b9f020ee6 (patch)
tree0096532c52ae8d0a00166b1b2e8d0980e5cb22f8 /lib/CodeGen/CGExpr.cpp
parentb4bc99ba5540a618c86c136c9112ead8fb1d9866 (diff)
User better API for vla in compund literals.
// rdar://11485774 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158157 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 5d1890635e..198a9bcd6f 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -2114,10 +2114,9 @@ LValue CodeGenFunction::EmitCompoundLiteralLValue(const CompoundLiteralExpr *E){
llvm::Value *GlobalPtr = CGM.GetAddrOfConstantCompoundLiteral(E);
return MakeAddrLValue(GlobalPtr, E->getType());
}
- if (const PointerType *pointerType = E->getType()->getAs<PointerType>())
- if (pointerType->getPointeeType()->isVariableArrayType())
- // make sure to emit the VLA size.
- EmitVariablyModifiedType(pointerType->getPointeeType());
+ if (E->getType()->isVariablyModifiedType())
+ // make sure to emit the VLA size.
+ EmitVariablyModifiedType(E->getType());
llvm::Value *DeclPtr = CreateMemTemp(E->getType(), ".compoundliteral");
const Expr *InitExpr = E->getInitializer();