diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-06-25 20:01:13 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-06-25 20:01:13 +0000 |
commit | 5304c953c1ccba4772ee77ce6526fff14ef5a16c (patch) | |
tree | 12e91f05ce869bef4a014677e23ff1a759836f7c /lib/CodeGen/CGExprCXX.cpp | |
parent | dd53ec9524cff66dfd7d4ea45ed651bf682a3254 (diff) |
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
Diffstat (limited to 'lib/CodeGen/CGExprCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGExprCXX.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
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); } |