Move access-path filtering into ModuleNameLookup (out of lookupValue) (#27097)

Removes duplicated logic from the implementations of
FileUnit::lookupValue, and simplifies the interface to
ModuleDecl::lookupValue, where everyone was passing an empty
(non-filtering) access path anyway /except/ during actual lookup from
source code. No functionality change.
This commit is contained in:
Jordan Rose
2019-09-10 09:13:20 -07:00
committed by GitHub
parent 04ae94fbf3
commit d4ac04d25e
21 changed files with 52 additions and 83 deletions

View File

@@ -3653,8 +3653,7 @@ static TypeAliasDecl *findTypeAliasForBuiltin(ASTContext &Ctx, Type T) {
StringRef TypeName = FullName.substr(8);
SmallVector<ValueDecl*, 4> CurModuleResults;
Ctx.TheBuiltinModule->lookupValue(ModuleDecl::AccessPathTy(),
Ctx.getIdentifier(TypeName),
Ctx.TheBuiltinModule->lookupValue(Ctx.getIdentifier(TypeName),
NLKind::QualifiedLookup,
CurModuleResults);
assert(CurModuleResults.size() == 1);