mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add getOperatorDecls to FileUnit and ModuleDecl
Query the SourceLookupCache for the operator decls, and use ModuleDecl::getOperatorDecls for both frontend stats and to clean up some code completion logic. In addition, this commit switches getPrecedenceGroups over to querying SourceLookupCache.
This commit is contained in:
@@ -2694,6 +2694,17 @@ void ModuleFile::getTopLevelDecls(
|
||||
}
|
||||
}
|
||||
|
||||
void ModuleFile::getOperatorDecls(SmallVectorImpl<OperatorDecl *> &results) {
|
||||
PrettyStackTraceModuleFile stackEntry(*this);
|
||||
if (!OperatorDecls)
|
||||
return;
|
||||
|
||||
for (auto entry : OperatorDecls->data()) {
|
||||
for (auto item : entry)
|
||||
results.push_back(cast<OperatorDecl>(getDecl(item.second)));
|
||||
}
|
||||
}
|
||||
|
||||
void ModuleFile::getPrecedenceGroups(
|
||||
SmallVectorImpl<PrecedenceGroupDecl*> &results) {
|
||||
PrettyStackTraceModuleFile stackEntry(*this);
|
||||
|
||||
Reference in New Issue
Block a user