mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add direct operator lookup requests
Introduce DirectOperatorLookupRequest & DirectPrecedenceGroupLookupRequest that lookup operator and precedence groups within a given file or module without looking through imports. These will eventually be used as the basis for the new operator lookup implementation, but for now just use them when querying lookup results from serialized module files.
This commit is contained in:
@@ -1084,14 +1084,17 @@ SerializedASTFile::lookupNestedType(Identifier name,
|
||||
return File.lookupNestedType(name, parent);
|
||||
}
|
||||
|
||||
OperatorDecl *SerializedASTFile::lookupOperator(Identifier name,
|
||||
OperatorFixity fixity) const {
|
||||
return File.lookupOperator(name, fixity);
|
||||
void SerializedASTFile::lookupOperatorDirect(
|
||||
Identifier name, OperatorFixity fixity,
|
||||
TinyPtrVector<OperatorDecl *> &results) const {
|
||||
if (auto *op = File.lookupOperator(name, fixity))
|
||||
results.push_back(op);
|
||||
}
|
||||
|
||||
PrecedenceGroupDecl *
|
||||
SerializedASTFile::lookupPrecedenceGroup(Identifier name) const {
|
||||
return File.lookupPrecedenceGroup(name);
|
||||
void SerializedASTFile::lookupPrecedenceGroupDirect(
|
||||
Identifier name, TinyPtrVector<PrecedenceGroupDecl *> &results) const {
|
||||
if (auto *group = File.lookupPrecedenceGroup(name))
|
||||
results.push_back(group);
|
||||
}
|
||||
|
||||
void SerializedASTFile::lookupVisibleDecls(ModuleDecl::AccessPathTy accessPath,
|
||||
|
||||
Reference in New Issue
Block a user