mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -80,7 +80,11 @@ private:
|
||||
|
||||
void doLocalLookup(ModuleDecl *module, ModuleDecl::AccessPathTy path,
|
||||
SmallVectorImpl<ValueDecl *> &localDecls) {
|
||||
module->lookupValue(path, name, lookupKind, localDecls);
|
||||
// If this import is specific to some named decl ("import Swift.Int")
|
||||
// then filter out any lookups that don't match.
|
||||
if (!ModuleDecl::matchesAccessPath(path, name))
|
||||
return;
|
||||
module->lookupValue(name, lookupKind, localDecls);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user