diff options
author | Anders Carlsson <andersca@mac.com> | 2009-11-22 19:25:33 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-11-22 19:25:33 +0000 |
commit | 09edb9c38cc7dc596d97d68ba6d23545c7ad3abd (patch) | |
tree | 02bf6aedd894ef0548a48035ab4f1d61aca94330 /lib | |
parent | e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9 (diff) |
Use EmitStoreOfScalar when copying the scalar to the space allocated by 'new'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89613 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/CGCXXExpr.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGCXXExpr.cpp b/lib/CodeGen/CGCXXExpr.cpp index 409296f716..845669d402 100644 --- a/lib/CodeGen/CGCXXExpr.cpp +++ b/lib/CodeGen/CGCXXExpr.cpp @@ -103,8 +103,9 @@ static void EmitNewInitializer(CodeGenFunction &CGF, const CXXNewExpr *E, const Expr *Init = E->getConstructorArg(0); - if (!CGF.hasAggregateLLVMType(AllocType)) - CGF.Builder.CreateStore(CGF.EmitScalarExpr(Init), NewPtr); + if (!CGF.hasAggregateLLVMType(AllocType)) + CGF.EmitStoreOfScalar(CGF.EmitScalarExpr(Init), NewPtr, + AllocType.isVolatileQualified(), AllocType); else if (AllocType->isAnyComplexType()) CGF.EmitComplexExprIntoAddr(Init, NewPtr, AllocType.isVolatileQualified()); |