Fix up a bunch of filtering-by-decl-access-path.

Mostly cleanup, a few filled-in FIXMEs to filter out decls that don't match
the access path name.

Swift SVN r6850
This commit is contained in:
Jordan Rose
2013-08-02 21:00:28 +00:00
parent c92fa28833
commit f03245a206
5 changed files with 34 additions and 17 deletions

View File

@@ -2132,7 +2132,17 @@ void ModuleFile::getReexportedModules(
void ModuleFile::lookupVisibleDecls(Module::AccessPathTy accessPath,
VisibleDeclConsumer &consumer,
NLKind lookupKind) {
// FIXME: Validate against access path.
assert(accessPath.size() <= 1 && "can only refer to top-level decls");
if (!accessPath.empty()) {
auto I = TopLevelDecls.find(accessPath.front().first);
if (I == TopLevelDecls.end()) return;
for (auto vd : I->second)
consumer.foundDecl(vd);
return;
}
for (auto &topLevelEntry : TopLevelDecls) {
for (auto &value : topLevelEntry.second)
consumer.foundDecl(value);