mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Type checker] Add "all members" request.
Introduce an "all members" request to compute all of the members of a given iterable declaration context in stable order. This builds on ABI members so that it will also include, e.g., type aliases synthesized for associated types.
This commit is contained in:
@@ -766,6 +766,14 @@ ArrayRef<Decl *> IterableDeclContext::getABIMembers() const {
|
||||
ArrayRef<Decl *>());
|
||||
}
|
||||
|
||||
ArrayRef<Decl *> IterableDeclContext::getAllMembers() const {
|
||||
ASTContext &ctx = getASTContext();
|
||||
return evaluateOrDefault(
|
||||
ctx.evaluator,
|
||||
AllMembersRequest{const_cast<IterableDeclContext *>(this)},
|
||||
ArrayRef<Decl *>());
|
||||
}
|
||||
|
||||
void IterableDeclContext::addMemberPreservingSourceOrder(Decl *member) {
|
||||
auto &SM = getASTContext().SourceMgr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user