mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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:
@@ -91,7 +91,7 @@ InstrumenterBase::InstrumenterBase(ASTContext &C, DeclContext *DC)
|
||||
|
||||
SmallVector<ValueDecl *, 1> results;
|
||||
TypeCheckDC->getParentModule()->lookupValue(
|
||||
{}, moduleIdentifier, NLKind::UnqualifiedLookup, results);
|
||||
moduleIdentifier, NLKind::UnqualifiedLookup, results);
|
||||
|
||||
ModuleIdentifier = (results.size() == 1) ? moduleIdentifier : Identifier();
|
||||
|
||||
@@ -107,7 +107,7 @@ InstrumenterBase::InstrumenterBase(ASTContext &C, DeclContext *DC)
|
||||
|
||||
results.clear();
|
||||
TypeCheckDC->getParentModule()->lookupValue(
|
||||
{}, fileIdentifier, NLKind::UnqualifiedLookup, results);
|
||||
fileIdentifier, NLKind::UnqualifiedLookup, results);
|
||||
|
||||
FileIdentifier = (results.size() == 1) ? fileIdentifier : Identifier();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user