]> granicus.if.org Git - clang/commitdiff
We don't generate null initializer expressions anymore, and
authorJohn McCall <rjmccall@apple.com>
Thu, 15 Sep 2011 01:54:21 +0000 (01:54 +0000)
committerJohn McCall <rjmccall@apple.com>
Thu, 15 Sep 2011 01:54:21 +0000 (01:54 +0000)
we don't need to.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139769 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGClass.cpp

index 6e0e1d418ff6b934208c87b616276d72ca2f9c8e..87eabe9e6e40611336420c3484480e255a6179c0 100644 (file)
@@ -559,11 +559,9 @@ static void EmitMemberInitializer(CodeGenFunction &CGF,
     LHS = CGF.EmitLValueForFieldInitialization(ThisPtr, Field, 0);
   }
 
-  // FIXME: If there's no initializer and the CXXCtorInitializer
-  // was implicitly generated, we shouldn't be zeroing memory.
-  if (FieldType->isArrayType() && !MemberInit->getInit()) {
-    CGF.EmitNullInitialization(LHS.getAddress(), Field->getType());
-  } else if (!CGF.hasAggregateLLVMType(Field->getType())) {
+  assert(MemberInit->getInit());
+
+  if (!CGF.hasAggregateLLVMType(Field->getType())) {
     if (LHS.isSimple()) {
       CGF.EmitExprAsInit(MemberInit->getInit(), Field, LHS, false);
     } else {