[Clang importer] Lazily load all named members with a matching base name.

When loading the named members for a given name, we want to load all
of the members with that base name... not only the ones that match the
full name, because the lookup table is indexed by base name and
filtering too early drops candidates.

Fixes rdar://problem/36085994.
This commit is contained in:
Doug Gregor
2017-12-15 22:57:11 -08:00
parent 0bfaa40385
commit 8c05278ef3
8 changed files with 36 additions and 9 deletions

View File

@@ -1793,7 +1793,7 @@ void ModuleFile::loadObjCMethods(
}
Optional<TinyPtrVector<ValueDecl *>>
ModuleFile::loadNamedMembers(const IterableDeclContext *IDC, DeclName N,
ModuleFile::loadNamedMembers(const IterableDeclContext *IDC, DeclBaseName N,
uint64_t contextData) {
PrettyStackTraceDecl trace("loading members for", IDC->getDecl());
@@ -1801,7 +1801,7 @@ ModuleFile::loadNamedMembers(const IterableDeclContext *IDC, DeclName N,
assert(DeclMemberNames);
TinyPtrVector<ValueDecl *> results;
auto i = DeclMemberNames->find(N.getBaseName());
auto i = DeclMemberNames->find(N);
if (i == DeclMemberNames->end())
return results;