[AST] Rename SubscriptDecl::create -> createParsed

And generate the DeclName using the argument labels
on the ParameterList.
This commit is contained in:
Hamish Knight
2023-12-15 19:53:52 +00:00
parent 9710a6575d
commit 8fdb48d910
3 changed files with 18 additions and 23 deletions

View File

@@ -8812,14 +8812,13 @@ SubscriptDecl::createDeserialized(ASTContext &Context, DeclName Name,
return SD;
}
SubscriptDecl *SubscriptDecl::create(ASTContext &Context, DeclName Name,
SourceLoc StaticLoc,
StaticSpellingKind StaticSpelling,
SourceLoc SubscriptLoc,
ParameterList *Indices, SourceLoc ArrowLoc,
TypeRepr *ElementTyR, DeclContext *Parent,
GenericParamList *GenericParams) {
SubscriptDecl *SubscriptDecl::createParsed(
ASTContext &Context, SourceLoc StaticLoc, StaticSpellingKind StaticSpelling,
SourceLoc SubscriptLoc, ParameterList *Indices, SourceLoc ArrowLoc,
TypeRepr *ElementTyR, DeclContext *Parent,
GenericParamList *GenericParams) {
assert(ElementTyR);
auto Name = DeclName(Context, DeclBaseName::createSubscript(), Indices);
auto *const SD = new (Context)
SubscriptDecl(Name, StaticLoc, StaticSpelling, SubscriptLoc, Indices,
ArrowLoc, ElementTyR, Parent, GenericParams);