mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add Builtin.hopToActor
SILGen this builtin to a mandatory hop_to_executor with an actor type
operand.
e.g.
Task.detached {
Builtin.hopToActor(MainActor.shared)
await suspend()
}
Required to fix a bug in _runAsyncMain.
This commit is contained in:
@@ -1570,6 +1570,14 @@ static ManagedValue emitBuiltinWithUnsafeThrowingContinuation(
|
||||
/*throws=*/true);
|
||||
}
|
||||
|
||||
static ManagedValue emitBuiltinHopToActor(SILGenFunction &SGF, SILLocation loc,
|
||||
SubstitutionMap subs,
|
||||
ArrayRef<ManagedValue> args,
|
||||
SGFContext C) {
|
||||
SGF.emitHopToActorValue(loc, args[0]);
|
||||
return ManagedValue::forUnmanaged(SGF.emitEmptyTuple(loc));
|
||||
}
|
||||
|
||||
static ManagedValue emitBuiltinAutoDiffCreateLinearMapContext(
|
||||
SILGenFunction &SGF, SILLocation loc, SubstitutionMap subs,
|
||||
ArrayRef<ManagedValue> args, SGFContext C) {
|
||||
|
||||
Reference in New Issue
Block a user