Refactor and generalize distributed actor transport SIL generation.

Refactor the code that generates SIL to call into the distributed actor
transport to eliminate duplication and better cope with concrete actor
transports. Centralize the knowledge of which actor transport is used
with a given distributed actor type.
This commit is contained in:
Doug Gregor
2021-10-30 21:49:35 -07:00
parent 22609acef5
commit 3da14e6f65
10 changed files with 209 additions and 264 deletions

View File

@@ -299,13 +299,11 @@ static ConstructorDecl *createImplicitConstructor(NominalTypeDecl *decl,
// copy access level of distributed actor init from the nominal decl
accessLevel = decl->getEffectiveAccess();
auto transportDecl = ctx.getActorTransportDecl();
// Create the parameter.
auto *arg = new (ctx) ParamDecl(SourceLoc(), Loc, ctx.Id_transport, Loc,
ctx.Id_transport, transportDecl);
ctx.Id_transport, decl);
arg->setSpecifier(ParamSpecifier::Default);
arg->setInterfaceType(transportDecl->getDeclaredInterfaceType());
arg->setInterfaceType(getDistributedActorTransportType(decl));
arg->setImplicit();
params.push_back(arg);