[prev in list] [next in list] [prev in thread] [next in thread]
List: cfe-commits
Subject: [cfe-commits] r94965 - /cfe/trunk/lib/CodeGen/CGClass.cpp
From: Eli Friedman <eli.friedman () gmail ! com>
Date: 2010-01-31 19:07:50
Message-ID: 201001311907.o0VJ7obN032238 () zion ! cs ! uiuc ! edu
[Download RAW message or body]
Author: efriedma
Date: Sun Jan 31 13:07:50 2010
New Revision: 94965
URL: http://llvm.org/viewvc/llvm-project?rev=94965&view=rev
Log:
Simplify EmitMemberInitializer; no intended functionality change.
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=94965&r1=94964&r2=94965&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGClass.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGClass.cpp Sun Jan 31 13:07:50 2010
@@ -834,24 +834,6 @@
FieldType = Field->getType();
}
- // If the field is an array, branch based on the element type.
- const ConstantArrayType *Array =
- CGF.getContext().getAsConstantArrayType(FieldType);
- if (Array)
- FieldType = CGF.getContext().getBaseElementType(FieldType);
-
- // We lose the constructor for anonymous union members, so handle them
- // explicitly.
- // FIXME: This is somwhat ugly, and doesn't seem necessary at all.
- if (MemberInit->getAnonUnionMember() && FieldType->getAs<RecordType>()) {
- if (MemberInit->getInit())
- CGF.EmitAggExpr(MemberInit->getInit(), LHS.getAddress(),
- LHS.isVolatileQualified());
- else
- CGF.EmitAggregateClear(LHS.getAddress(), Field->getType());
- return;
- }
-
// FIXME: If there's no initializer and the CXXBaseOrMemberInitializer
// was implicitly generated, we shouldn't be zeroing memory.
RValue RHS;
@@ -859,7 +841,7 @@
RHS = CGF.EmitReferenceBindingToExpr(MemberInit->getInit(), FieldType,
/*IsInitializer=*/true);
CGF.EmitStoreThroughLValue(RHS, LHS, FieldType);
- } else if (Array && !MemberInit->getInit()) {
+ } else if (FieldType->isArrayType() && !MemberInit->getInit()) {
CGF.EmitMemSetToZero(LHS.getAddress(), Field->getType());
} else if (!CGF.hasAggregateLLVMType(Field->getType())) {
RHS = RValue::get(CGF.EmitScalarExpr(MemberInit->getInit(), true));
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic