Skip to content

Commit 469f34e

Browse files
committed
Clean up ClangRecordMemberLookup::evaluate slightly
1 parent 499146d commit 469f34e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6152,6 +6152,8 @@ TinyPtrVector<ValueDecl *> ClangRecordMemberLookup::evaluate(
61526152
NominalTypeDecl *inheritingDecl = desc.inheritingDecl;
61536153
DeclName name = desc.name;
61546154

6155+
bool inheritedLookup = recordDecl != inheritingDecl;
6156+
61556157
auto &ctx = recordDecl->getASTContext();
61566158
auto directResults = evaluateOrDefault(
61576159
ctx.evaluator,
@@ -6177,7 +6179,7 @@ TinyPtrVector<ValueDecl *> ClangRecordMemberLookup::evaluate(
61776179

61786180
// If this member is found due to inheritance, clone it from the base class
61796181
// by synthesizing getters and setters.
6180-
if (inheritingDecl != recordDecl) {
6182+
if (inheritedLookup) {
61816183
imported = clangModuleLoader->importBaseMemberDecl(
61826184
cast<ValueDecl>(imported), inheritingDecl);
61836185
if (!imported)
@@ -6186,8 +6188,8 @@ TinyPtrVector<ValueDecl *> ClangRecordMemberLookup::evaluate(
61866188
result.push_back(cast<ValueDecl>(imported));
61876189
}
61886190

6189-
if (inheritingDecl != recordDecl) {
6190-
// For inheritied members, add members that are synthesized eagerly, such as
6191+
if (inheritedLookup) {
6192+
// For inherited members, add members that are synthesized eagerly, such as
61916193
// subscripts. This is not necessary for non-inherited members because those
61926194
// should already be in the lookup table.
61936195
for (auto member :

0 commit comments

Comments
 (0)