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

@@ -213,8 +213,11 @@ void SerializedModuleLoader::lookupValue(Module *module,
Module::AccessPathTy accessPath,
Identifier name, NLKind lookupKind,
SmallVectorImpl<ValueDecl*> &results) {
// FIXME: handle nested modules.
if (!accessPath.empty())
assert(accessPath.size() <= 1 && "can only refer to top-level decls");
// If this import is specific to some named type or decl ("import swift.int")
// then filter out any lookups that don't match.
if (accessPath.size() == 1 && accessPath.front().first != name)
return;
ModuleFile *moduleFile = cast<SerializedModule>(module)->File;