[cfe-commits] r99889 - /cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Anders Carlsson
andersca at mac.com
Tue Mar 30 08:39:27 PDT 2010
Author: andersca
Date: Tue Mar 30 10:39:27 2010
New Revision: 99889
URL: http://llvm.org/viewvc/llvm-project?rev=99889&view=rev
Log:
Reduce nesting.
Modified:
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=99889&r1=99888&r2=99889&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Tue Mar 30 10:39:27 2010
@@ -1679,25 +1679,25 @@
static void *GetKeyForMember(CXXBaseOrMemberInitializer *Member,
bool MemberMaybeAnon = false) {
+ if (!Member->isMemberInitializer())
+ return GetKeyForBase(QualType(Member->getBaseClass(), 0));
+
// For fields injected into the class via declaration of an anonymous union,
// use its anonymous union class declaration as the unique key.
- if (Member->isMemberInitializer()) {
- FieldDecl *Field = Member->getMember();
+ FieldDecl *Field = Member->getMember();
- // After SetBaseOrMemberInitializers call, Field is the anonymous union
- // data member of the class. Data member used in the initializer list is
- // in AnonUnionMember field.
- if (MemberMaybeAnon && Field->isAnonymousStructOrUnion())
- Field = Member->getAnonUnionMember();
- if (Field->getDeclContext()->isRecord()) {
- RecordDecl *RD = cast<RecordDecl>(Field->getDeclContext());
- if (RD->isAnonymousStructOrUnion())
- return static_cast<void *>(RD);
- }
- return static_cast<void *>(Field);
+ // After SetBaseOrMemberInitializers call, Field is the anonymous union
+ // data member of the class. Data member used in the initializer list is
+ // in AnonUnionMember field.
+ if (MemberMaybeAnon && Field->isAnonymousStructOrUnion())
+ Field = Member->getAnonUnionMember();
+ if (Field->getDeclContext()->isRecord()) {
+ RecordDecl *RD = cast<RecordDecl>(Field->getDeclContext());
+ if (RD->isAnonymousStructOrUnion())
+ return static_cast<void *>(RD);
}
- return GetKeyForBase(QualType(Member->getBaseClass(), 0));
+ return static_cast<void *>(Field);
}
/// ActOnMemInitializers - Handle the member initializers for a constructor.
More information about the cfe-commits
mailing list