From ec22f56f2031c3e61100d42133b06f9b9f020ee6 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 7 Jun 2012 18:15:55 +0000 Subject: 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 --- lib/CodeGen/CGExpr.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/CodeGen/CGExpr.cpp') 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()) - 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(); -- cgit v1.2.3-70-g09d2