[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

@@ -70,8 +70,8 @@ static Expr *constructUnownedSerialExecutor(ASTContext &ctx,
// (Builtin.Executor) -> UnownedSerialExecutor
auto metatypeRef = TypeExpr::createImplicit(executorType, ctx);
Type ctorAppliedType = ctorType->getAs<FunctionType>()->getResult();
auto selfApply = new (ctx) ConstructorRefCallExpr(initRef, metatypeRef,
ctorAppliedType);
auto selfApply = ConstructorRefCallExpr::create(ctx, initRef, metatypeRef,
ctorAppliedType);
selfApply->setImplicit(true);
selfApply->setThrows(false);