-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Distributed] Generate SIL for DistributedActor.resolve #38938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci smoke test |
5b568f7
to
0daa9cc
Compare
e41627a
to
20bd427
Compare
20bd427
to
cb0dc1d
Compare
@swift-ci smoke test |
auto switchBB = createBasicBlock(); | ||
auto errorBB = createBasicBlock(); | ||
|
||
SILFunctionConventions fnConv = F.getConventions(); // TODO: no idea? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SILFunctionConventions fnConv = F.getConventions(); // TODO: no idea? | |
SILFunctionConventions fnConv = F.getConventions(); |
seems to be right I guess :)
// --- get the uninitialized allocation from the runtime system. | ||
FullExpr scope(Cleanups, CleanupLocation(fd)); | ||
|
||
auto optionalReturnTy = SILType::getOptionalType(returnTy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice optionals made things a bit easier :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! We can remove the TODOs that this addressed I guess
auto local = resolvedBB->createPhiArgument(returnTy, OwnershipKind::Owned); | ||
|
||
B.createBranch(loc, returnBB, {local}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nice, not too hard then 👍
assert(transportVarDeclRefs.size() == 1); | ||
auto *transportVarDeclRef = dyn_cast<VarDecl>(transportVarDeclRefs.front()); | ||
auto transportVarDeclRef = lookupActorTransportProperty(ctx, cd, selfValue); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
if (fd->isDistributedActorFactory()) { | ||
// Synthesize the factory function body | ||
emitDistributedActorFactory(fd); | ||
} else { | ||
prepareEpilog(true, fd->hasThrows(), CleanupLocation(fd)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, so we emit the cleanups ourselves ok 👍
@@ -48,7 +48,7 @@ public protocol ActorTransport: Sendable { | |||
/// | |||
/// Detecting liveness of such remote actors shall be offered / by transport libraries | |||
/// by other means, such as "watching an actor for termination" or similar. | |||
func resolve<Act>(_ identity: AnyActorIdentity, as actorType: Act.Type) throws -> ActorResolved<Act> // TODO(distributed): make just optional | |||
func resolve<Act>(_ identity: AnyActorIdentity, as actorType: Act.Type) throws -> Act? // TODO(distributed): make just optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func resolve<Act>(_ identity: AnyActorIdentity, as actorType: Act.Type) throws -> Act? // TODO(distributed): make just optional | |
func resolve<Act>(_ identity: AnyActorIdentity, as actorType: Act.Type) throws -> Act? |
cb0dc1d
to
bd62b7a
Compare
@swift-ci smoke test |
bd62b7a
to
d69ab78
Compare
@swift-ci smoke test |
d69ab78
to
3161d8f
Compare
@swift-ci smoke test |
@@ -41,9 +47,11 @@ llvm::Value *irgen::emitDistributedActorInitializeRemote( | |||
call->setCallingConv(IGF.IGM.SwiftCC); | |||
call->setDoesNotThrow(); | |||
|
|||
out.add(call); | |||
auto result = IGF.Builder.CreateBitCast(call, destType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh I see, very good to know..! Thanks a lot!
…st-resolve" (swiftlang#38994)" This reverts commit f6ae9f3.
rdar://78484431