[Distributed] Implementing calling transport in resolve and assigning id/transp

This commit is contained in:
Konrad `ktoso` Malawski
2021-08-10 22:18:38 +09:00
parent a965abd7f0
commit 7e0a3eba13
15 changed files with 276 additions and 122 deletions

View File

@@ -1197,29 +1197,3 @@ void SILGenFunction::emitIVarInitializer(SILDeclRef ivarInitializer) {
emitEpilog(loc);
}
void SILGenFunction::emitDistributedActorFactory(FuncDecl *fd) {
/// NOTE: this will only be reached if the resolve function is actually
/// demanded. For example, by declaring the actor as `public` or
/// having at least one call to the resolve init.
SILLocation loc = fd; // NOTE: forgot if this is the right one for all locs.
ClassDecl *actor = cast<ClassDecl>(fd->getDeclContext()->getAsDecl());
assert(actor->isDistributedActor());
// Step 1: get the uninitialized allocation from the runtime system.
auto &ctx = getASTContext();
auto builtinName = ctx.getIdentifier(
getBuiltinName(BuiltinValueKind::InitializeDistributedRemoteActor));
auto returnType = getLoweredType(actor->getInterfaceType());
auto *metaTypeInfo = F.getArgument(0);
FullExpr scope(Cleanups, CleanupLocation(fd));
auto *result = B.createBuiltin(loc, builtinName, returnType, /*subs*/{},
{ metaTypeInfo });
// TODO: initialize the id and transport fields
B.createReturn(loc, result);
}