mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Renovate name lookup to prepare for compound name lookup.
Make the name lookup interfaces all take DeclNames instead of identifiers, and update the lookup caches of the various file units to index their members by both compound name and simple name. Serialized modules are keyed by identifiers, so as a transitional hack, do simple name lookup then filter the results by compound name. Swift SVN r14768
This commit is contained in:
@@ -276,16 +276,11 @@ bool SerializedASTFile::isSystemModule() const {
|
||||
}
|
||||
|
||||
void SerializedASTFile::lookupValue(Module::AccessPathTy accessPath,
|
||||
Identifier name, NLKind lookupKind,
|
||||
DeclName name, NLKind lookupKind,
|
||||
SmallVectorImpl<ValueDecl*> &results) const{
|
||||
assert(accessPath.size() <= 1 && "can only refer to top-level decls");
|
||||
|
||||
// If this import is specific to some named type or decl
|
||||
// ("import typealias Swift.Int"), then filter out any lookups that
|
||||
// don't match.
|
||||
if (accessPath.size() == 1 && accessPath.front().first != name)
|
||||
if (!Module::matchesAccessPath(accessPath, name))
|
||||
return;
|
||||
|
||||
|
||||
File.lookupValue(name, results);
|
||||
}
|
||||
|
||||
@@ -307,7 +302,7 @@ void SerializedASTFile::lookupClassMembers(Module::AccessPathTy accessPath,
|
||||
|
||||
void
|
||||
SerializedASTFile::lookupClassMember(Module::AccessPathTy accessPath,
|
||||
Identifier name,
|
||||
DeclName name,
|
||||
SmallVectorImpl<ValueDecl*> &decls) const {
|
||||
File.lookupClassMember(accessPath, name, decls);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user