aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprCXX.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-02-16 22:45:48 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-02-16 22:45:48 +0000
commit22cfaf512e4f66105fb1f8dd39e0a77787fbdf9b (patch)
tree836dc88bd53e8fb7e71a5aa36b414520341a51c2 /lib/CodeGen/CGExprCXX.cpp
parent3336353578a02eb7dc35926c2440577993196e36 (diff)
Elide copy construction in new expressions. PR11757.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprCXX.cpp')
-rw-r--r--lib/CodeGen/CGExprCXX.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp
index 12bdc7e43f..47e57032e0 100644
--- a/lib/CodeGen/CGExprCXX.cpp
+++ b/lib/CodeGen/CGExprCXX.cpp
@@ -890,20 +890,6 @@ static void EmitNewInitializer(CodeGenFunction &CGF, const CXXNewExpr *E,
return;
}
- if (const CXXConstructExpr *CCE = dyn_cast_or_null<CXXConstructExpr>(Init)) {
- CXXConstructorDecl *Ctor = CCE->getConstructor();
- // Per C++ [expr.new]p15, if we have an initializer, then we're performing
- // direct initialization. C++ [dcl.init]p5 requires that we
- // zero-initialize storage if there are no user-declared constructors.
- if (!Ctor->getParent()->hasUserDeclaredConstructor() &&
- !Ctor->getParent()->isEmpty())
- CGF.EmitNullInitialization(NewPtr, ElementType);
-
- CGF.EmitCXXConstructorCall(Ctor, Ctor_Complete, /*ForVirtualBase=*/false,
- NewPtr, CCE->arg_begin(), CCE->arg_end());
- return;
- }
- // We have a POD type.
if (!Init)
return;