[cfe-commits] r139769 - /cfe/trunk/lib/CodeGen/CGClass.cpp

John McCall rjmccall at apple.com
Wed Sep 14 18:54:21 PDT 2011


Author: rjmccall
Date: Wed Sep 14 20:54:21 2011
New Revision: 139769

URL: http://llvm.org/viewvc/llvm-project?rev=139769&view=rev
Log:
We don't generate null initializer expressions anymore, and
we don't need to.


Modified:
    cfe/trunk/lib/CodeGen/CGClass.cpp

Modified: cfe/trunk/lib/CodeGen/CGClass.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGClass.cpp?rev=139769&r1=139768&r2=139769&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGClass.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGClass.cpp Wed Sep 14 20:54:21 2011
@@ -559,11 +559,9 @@
     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 {





More information about the cfe-commits mailing list