From: Fariborz Jahanian Date: Fri, 25 Jun 2010 20:01:13 +0000 (+0000) Subject: Minor change to my last patch to fix PR7490. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5304c953c1ccba4772ee77ce6526fff14ef5a16c;p=clang Minor change to my last patch to fix PR7490. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106875 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp index 3e34f2267d..a23dc154c5 100644 --- a/lib/CodeGen/CGExprCXX.cpp +++ b/lib/CodeGen/CGExprCXX.cpp @@ -483,9 +483,6 @@ static llvm::Value *EmitCXXNewAllocSize(ASTContext &Context, static void StoreAnyExprIntoOneUnit(CodeGenFunction &CGF, const CXXNewExpr *E, llvm::Value *NewPtr) { - // We have a POD type. - if (E->getNumConstructorArgs() == 0) - return; assert(E->getNumConstructorArgs() == 1 && "Can only have one argument to initializer of POD type."); @@ -507,6 +504,10 @@ void CodeGenFunction::EmitNewArrayInitializer(const CXXNewExpr *E, llvm::Value *NewPtr, llvm::Value *NumElements) { + // We have a POD type. + if (E->getNumConstructorArgs() == 0) + return; + const llvm::Type *SizeTy = ConvertType(getContext().getSizeType()); // Create a temporary for the loop index and initialize it with 0. @@ -577,7 +578,10 @@ static void EmitNewInitializer(CodeGenFunction &CGF, const CXXNewExpr *E, return; } - + // We have a POD type. + if (E->getNumConstructorArgs() == 0) + return; + StoreAnyExprIntoOneUnit(CGF, E, NewPtr); }