[AST] Add some 'create' factory methods

This provides consistency with other AST nodes,
and will be useful for implementing ArgumentList
construction in the future.
This commit is contained in:
Hamish Knight
2021-07-28 23:14:44 +01:00
parent c70f280e4a
commit 72d4d9f1e9
12 changed files with 87 additions and 49 deletions

View File

@@ -123,7 +123,8 @@ deriveBodyEquatable_enum_noAssociatedValues_eq(AbstractFunctionDecl *eqDecl,
AccessSemantics::Ordinary, fnType);
fnType = fnType->getResult()->castTo<FunctionType>();
auto *callExpr = new (C) DotSyntaxCallExpr(ref, SourceLoc(), base, fnType);
auto *callExpr =
DotSyntaxCallExpr::create(C, ref, SourceLoc(), base, fnType);
callExpr->setImplicit();
callExpr->setThrows(false);
cmpFuncExpr = callExpr;