From 759e41baf6a95c3a265970b6bf1c97c233fd28b0 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sun, 22 Aug 2010 16:15:35 +0000 Subject: When performing value-initialization for a class with a non-trivial, implicitly-defined default constructor, zero-initialize the memory before calling the default constructor. Previously, we would only zero-initialize in the case of a trivial default constructor. Also, simplify the hideous logic that determines when we have a trivial default constructor and, therefore, don't need to emit any call at all. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111779 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprAgg.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lib/CodeGen/CGExprAgg.cpp') diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 890a07f9fb..1b6254f192 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -450,10 +450,6 @@ AggExprEmitter::VisitCXXConstructExpr(const CXXConstructExpr *E) { if (!Val) // Create a temporary variable. Val = CGF.CreateMemTemp(E->getType(), "tmp"); - if (E->requiresZeroInitialization()) - EmitNullInitializationToLValue(CGF.MakeAddrLValue(Val, E->getType()), - E->getType()); - CGF.EmitCXXConstructExpr(Val, E); } -- cgit v1.2.3