mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[silgen] Change two places we used Builtin.Executor to instead use Optional<any Actor> as an expected executor.
We want SILGen to have a simplified view of its executor and know that whenever one sees an Actor, it is an actual actor instead of a Builtin.Executor. This just simplifies code. Also, we should eventually have an invariant that Builtin.Executor should only be allowed in LoweredSIL after LowerHopToExecutor has run. But that is a change for another day.
This commit is contained in:
@@ -27,7 +27,7 @@ using namespace Lowering;
|
||||
|
||||
static void setExpectedExecutorForGeneric(SILGenFunction &SGF) {
|
||||
auto loc = RegularLocation::getAutoGeneratedLocation(SGF.F.getLocation());
|
||||
SGF.ExpectedExecutor.set(SGF.emitGenericExecutor(loc));
|
||||
SGF.ExpectedExecutor.set(SGF.emitNonIsolatedIsolation(loc).getValue());
|
||||
}
|
||||
|
||||
static void setExpectedExecutorForGlobalActor(SILGenFunction &SGF,
|
||||
@@ -284,8 +284,9 @@ void SILGenFunction::emitConstructorExpectedExecutorProlog() {
|
||||
loc.markAsPrologue();
|
||||
loc = loc.asAutoGenerated();
|
||||
|
||||
auto initialExecutor = emitGenericExecutor(loc);
|
||||
B.createHopToExecutor(loc, initialExecutor, /*mandatory*/ false);
|
||||
auto initialExecutor = emitNonIsolatedIsolation(loc);
|
||||
B.createHopToExecutor(loc, initialExecutor.getValue(),
|
||||
/*mandatory*/ false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,6 +152,8 @@ public func testCallerToCaller(_ x: nonisolated(nonsending) @escaping () async -
|
||||
|
||||
// CHECK-LABEL: sil [ossa] @$s21attr_execution_silgen24testCallerLocalVariablesyyyyYaYCcYaF : $@convention(thin) @async (@guaranteed @async @callee_guaranteed (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>) -> ()) -> () {
|
||||
// CHECK: bb0([[PARAM:%.*]] : @guaranteed $@async @callee_guaranteed (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>) -> ()):
|
||||
// CHECK: [[ACTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK: hop_to_executor [[ACTOR]]
|
||||
// CHECK: [[PARAM_COPY:%.*]] = copy_value [[PARAM]]
|
||||
// CHECK: [[Y:%.*]] = move_value [lexical] [var_decl] [[PARAM_COPY]]
|
||||
// CHECK: [[Y_B:%.*]] = begin_borrow [[Y]]
|
||||
@@ -159,7 +161,6 @@ public func testCallerToCaller(_ x: nonisolated(nonsending) @escaping () async -
|
||||
// CHECK: [[Y2:%.*]] = move_value [lexical] [var_decl] [[Y_B_C]]
|
||||
// CHECK: [[Y2_B:%.*]] = begin_borrow [[Y2]]
|
||||
// CHECK: [[Y2_B_C:%.*]] = copy_value [[Y2_B]]
|
||||
// CHECK: [[ACTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK: [[Y2_B_C_B:%.*]] = begin_borrow [[Y2_B_C]]
|
||||
// CHECK: apply [[Y2_B_C_B]]([[ACTOR]])
|
||||
// CHECK: } // end sil function '$s21attr_execution_silgen24testCallerLocalVariablesyyyyYaYCcYaF'
|
||||
@@ -522,7 +523,7 @@ func testThatClosuresAssumeIsolation(fn: inout nonisolated(nonsending) (Int) asy
|
||||
testParam { 42 }
|
||||
|
||||
// CHECK-LABEL: sil private [ossa] @$s21attr_execution_silgen31testThatClosuresAssumeIsolation2fnyySiYaYCcz_tFyyYaXEfU1_ : $@convention(thin) @async () -> ()
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
testParam { @concurrent in 42 }
|
||||
|
||||
@@ -538,7 +539,7 @@ func testThatClosuresAssumeIsolation(fn: inout nonisolated(nonsending) (Int) asy
|
||||
fn = { _ in }
|
||||
|
||||
// CHECK-LABEL: sil private [ossa] @$s21attr_execution_silgen31testThatClosuresAssumeIsolation2fnyySiYaYCcz_tFySiYacfU3_ : $@convention(thin) @async (Int) -> ()
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
// CHECK: } // end sil function '$s21attr_execution_silgen31testThatClosuresAssumeIsolation2fnyySiYaYCcz_tFySiYacfU3_'
|
||||
|
||||
@@ -557,7 +558,7 @@ func testNoIsolationTransfer() {
|
||||
func testErasure(@_inheritActorContext _: @escaping @isolated(any) () async -> Void) {}
|
||||
|
||||
// CHECK-LABEL: sil private [ossa] @$s21attr_execution_silgen23testNoIsolationTransferyyFyyYacfU_ : $@convention(thin) @async (@guaranteed Optional<any Actor>) -> ()
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
testErasure { @concurrent in }
|
||||
}
|
||||
@@ -566,7 +567,7 @@ func testClosuresDontAssumeGlobalActorWithMarkedAsConcurrent() {
|
||||
func test(_ fn: @MainActor () async -> Void) {}
|
||||
|
||||
// CHECK-LABEL: sil private [ossa] @$s21attr_execution_silgen55testClosuresDontAssumeGlobalActorWithMarkedAsConcurrentyyFyyYaYbXEfU_
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
// CHECK: } // end sil function '$s21attr_execution_silgen55testClosuresDontAssumeGlobalActorWithMarkedAsConcurrentyyFyyYaYbXEfU_'
|
||||
test { @Sendable @concurrent in
|
||||
|
||||
@@ -41,15 +41,13 @@ func testMainActorDispatch<T: P>(t: T) async {
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s9witnesses19testGenericExecutor1tyx_tYaAA1PRzlF : $@convention(thin) @async <T where T : P> (@in_guaranteed T) -> ()
|
||||
// CHECK: [[CONTEXT_ISOLATION:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK: [[CONTEXT_ISOLATION:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-NEXT: hop_to_executor [[CONTEXT_ISOLATION]]
|
||||
// CHECK-NEXT: [[ISOLATION_ERASED_TO_ACTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-NEXT: [[PROP_WITNESS:%.*]] = witness_method $T, #P.prop!getter : <Self where Self : P> (Self) -> () async -> String : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>, @in_guaranteed τ_0_0) -> @owned String
|
||||
// CHECK-NEXT: {{.*}} = apply [[PROP_WITNESS]]<T>([[ISOLATION_ERASED_TO_ACTOR]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>, @in_guaranteed τ_0_0) -> @owned String
|
||||
// CHECK-NEXT: {{.*}} = apply [[PROP_WITNESS]]<T>([[CONTEXT_ISOLATION]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>, @in_guaranteed τ_0_0) -> @owned String
|
||||
// CHECK-NEXT: hop_to_executor [[CONTEXT_ISOLATION]]
|
||||
// CHECK: [[ISOLATION_ERASED_TO_ACTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-NEXT: [[FN_WITNESS:%.*]] = witness_method $T, #P.fn : <Self where Self : P> (Self) -> () async -> () : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>, @in_guaranteed τ_0_0) -> ()
|
||||
// CHECK-NEXT: {{.*}} = apply [[FN_WITNESS]]<T>([[ISOLATION_ERASED_TO_ACTOR]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>, @in_guaranteed τ_0_0) -> ()
|
||||
// CHECK: [[FN_WITNESS:%.*]] = witness_method $T, #P.fn : <Self where Self : P> (Self) -> () async -> () : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>, @in_guaranteed τ_0_0) -> ()
|
||||
// CHECK-NEXT: {{.*}} = apply [[FN_WITNESS]]<T>([[CONTEXT_ISOLATION]], %0) : $@convention(witness_method: P) @async <τ_0_0 where τ_0_0 : P> (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>, @in_guaranteed τ_0_0) -> ()
|
||||
// CHECK: } // end sil function '$s9witnesses19testGenericExecutor1tyx_tYaAA1PRzlF'
|
||||
func testGenericExecutor<T: P>(t: T) async {
|
||||
_ = await t.prop
|
||||
|
||||
@@ -7,12 +7,12 @@ import OtherActors
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test6check1ySi11OtherActors0C11ModuleActorCYaF : $@convention(thin) @async (@guaranteed OtherModuleActor) -> Int {
|
||||
// CHECK: bb0([[SELF:%[0-9]+]] : @guaranteed $OtherModuleActor):
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $OtherModuleActor, #OtherModuleActor.a
|
||||
// CHECK: hop_to_executor [[SELF]] : $OtherModuleActor
|
||||
// CHECK-NEXT: load [trivial] [[REF]]
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]]
|
||||
// CHECK: } // end sil function '$s4test6check1ySi11OtherActors0C11ModuleActorCYaF'
|
||||
func check1(_ actor: OtherModuleActor) async -> Int {
|
||||
return await actor.a
|
||||
@@ -24,23 +24,23 @@ func check2(_ actor: isolated OtherModuleActor) -> Int {
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test6check3ySi11OtherActors0C11ModuleActorCYaF : $@convention(thin) @async (@guaranteed OtherModuleActor) -> Int {
|
||||
// CHECK: bb0([[SELF:%[0-9]+]] : @guaranteed $OtherModuleActor):
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]]
|
||||
func check3(_ actor: OtherModuleActor) async -> Int {
|
||||
return actor.b
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test6check4y11OtherActors17SomeSendableClassCSgAC0C11ModuleActorCSgYaF : $@convention(thin) @async (@guaranteed Optional<OtherModuleActor>) -> @owned Optional<SomeSendableClass> {
|
||||
// CHECK: bb0({{%[0-9]+}} : @guaranteed $Optional<OtherModuleActor>):
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]]
|
||||
// CHECK: switch_enum {{%[0-9]+}} : $Optional<OtherModuleActor>, case #Optional.some!enumelt: [[SOME:bb[0-9]+]], case #Optional.none!enumelt: {{bb[0-9]+}}
|
||||
|
||||
// CHECK: [[SOME]]({{%[0-9]+}} : @owned $OtherModuleActor):
|
||||
// CHECK: [[REF:%[0-9]+]] = ref_element_addr {{%[0-9]+}} : $OtherModuleActor, #OtherModuleActor.d
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $OtherModuleActor
|
||||
// CHECK-NEXT: load [copy] [[REF]]
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]]
|
||||
// CHECK: } // end sil function '$s4test6check4y11OtherActors17SomeSendableClassCSgAC0C11ModuleActorCSgYaF'
|
||||
func check4(_ actor: OtherModuleActor?) async -> SomeSendableClass? {
|
||||
return await actor?.d
|
||||
|
||||
@@ -27,11 +27,11 @@ func mainActorMultiDefaultArg(x: Int = requiresMainActor(),
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s30isolated_default_argument_eval22nonisolatedAsyncCalleryyYaF
|
||||
func nonisolatedAsyncCaller() async {
|
||||
// CHECK: hop_to_executor {{.*}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{.*}}
|
||||
// CHECK: hop_to_executor {{.*}} : $MainActor
|
||||
// CHECK: [[GET_VALUE:%[0-9]+]] = function_ref @$s30isolated_default_argument_eval19mainActorDefaultArg5valueS2i_tFfA_
|
||||
// CHECK-NEXT: apply [[GET_VALUE]]()
|
||||
// CHECK: hop_to_executor {{.*}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{.*}}
|
||||
await mainActorDefaultArg()
|
||||
|
||||
// CHECK: hop_to_executor {{.*}} : $MainActor
|
||||
@@ -46,7 +46,7 @@ func nonisolatedAsyncCaller() async {
|
||||
// CHECK-NOT: hop_to_executor
|
||||
// CHECK: [[GET_Z:%[0-9]+]] = function_ref @$s30isolated_default_argument_eval24mainActorMultiDefaultArg1x1y5tuple1zySi_S2i_SitSitFfA2_
|
||||
// CHECK-NEXT: apply [[GET_Z]]()
|
||||
// CHECK: hop_to_executor {{.*}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{.*}}
|
||||
await mainActorMultiDefaultArg()
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ var argValue: Int { 0 }
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s30isolated_default_argument_eval20passInoutWithDefaultyyYaF
|
||||
func passInoutWithDefault() async {
|
||||
// CHECK: hop_to_executor {{.*}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{.*}}
|
||||
|
||||
var x = 0
|
||||
|
||||
@@ -69,7 +69,7 @@ func passInoutWithDefault() async {
|
||||
// CHECK-NEXT: [[Z:%[0-9]+]] = apply [[GET_Z]]()
|
||||
// CHECK: [[FN:%[0-9]+]] = function_ref @$s30isolated_default_argument_eval0A15DefaultInoutMix1x1y1zySiz_S2itF : $@convention(thin) (@inout Int, Int, Int) -> ()
|
||||
// CHECK: apply [[FN]]([[INOUT_X]], [[ARG_VALUE]], [[Z]])
|
||||
// CHECK: hop_to_executor {{.*}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{.*}}
|
||||
await isolatedDefaultInoutMix(x: &x, y: argValue)
|
||||
}
|
||||
|
||||
|
||||
@@ -3107,7 +3107,7 @@ func callNonMatching_f1(_ b: Bool) -> (Int, Float, Bool, Float) {
|
||||
// CHECK: [[SUCCESS]]:
|
||||
// CHECK: call i1 (ptr, i1, ...) @llvm.coro.end.async(ptr {{%.*}}, i1 false, ptr @"$s16typed_throws_abi20nonMatching_f0_asyncySf_SftSbYaAA7OneWordVYKF{{.*}}", ptr {{%.*}}, ptr {{%.*}}, float 1.000000e+00, float 2.000000e+00, i64 undef, ptr null)
|
||||
// CHECK: unreachable
|
||||
// CHECK: 18:
|
||||
// CHECK: [[ERROR]]:
|
||||
// CHECK: [[ERROR_X:%.*]] = call swiftcc i64 @"$s16typed_throws_abi7OneWordVACycfC"()
|
||||
// CHECK: [[ERROR_RET:%.*]] = insertvalue { float, float, i64 } undef, i64 [[ERROR_X]], 2
|
||||
// CHECK: [[ERROR_RET0:%.*]] = extractvalue { float, float, i64 } [[ERROR_RET]], 0
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// REQUIRES: concurrency
|
||||
|
||||
import Swift
|
||||
import _Concurrency
|
||||
|
||||
public struct X {
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test1XV14getCurrentTaskBoyYaF
|
||||
|
||||
@@ -64,7 +64,7 @@ actor MyActor {
|
||||
// CHECK-DAG: sil hidden [ossa] @$s12initializers7MyActorCACyYacfc : $@convention(method) @async (@sil_isolated @owned MyActor) -> @owned MyActor
|
||||
// CHECK: bb0(%0 : @owned $MyActor):
|
||||
// In the prologue, hop to the generic executor.
|
||||
// CHECK-NEXT: [[NIL_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK-NEXT: [[NIL_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[NIL_EXECUTOR]] :
|
||||
// Later, when we return from an async call, hop to the
|
||||
// correct flow-sensitive value.
|
||||
@@ -169,12 +169,12 @@ enum Birb {
|
||||
}
|
||||
|
||||
// NI-LABEL: sil hidden [ossa] @$s12initializers7makeCatyyYaF : $@convention(thin) @async () -> () {
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: hop_to_executor [[BORROWED_EXECUTOR:%[0-9]+]]
|
||||
// NI: end_borrow [[BORROWED_EXECUTOR]]
|
||||
// NI-NEXT: {{%[0-9]+}} = apply {{%[0-9]+}}({{%[0-9]+}}, {{%[0-9]+}}) : $@convention(method) (@owned String, @thick Cat.Type) -> @owned Cat
|
||||
// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: } // end sil function '$s12initializers7makeCatyyYaF'
|
||||
|
||||
// NI-NS-LABEL: sil hidden [ossa] @$s12initializers7makeCatyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>) -> () {
|
||||
@@ -192,12 +192,12 @@ func makeCat() async {
|
||||
}
|
||||
|
||||
// NI-LABEL: sil hidden [ossa] @$s12initializers7makeDogyyYaF : $@convention(thin) @async () -> () {
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: hop_to_executor [[BORROWED_EXEC:%.*]] :
|
||||
// NI-NEXT: end_borrow [[BORROWED_EXEC]]
|
||||
// NI-NEXT: {{%[0-9]+}} = apply {{%[0-9]+}}({{%[0-9]+}}, {{%[0-9]+}}) : $@convention(method) (@owned String, @thin Dog.Type) -> Dog
|
||||
// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: } // end sil function '$s12initializers7makeDogyyYaF'
|
||||
|
||||
// NI-NS-LABEL: sil hidden [ossa] @$s12initializers7makeDogyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>) -> () {
|
||||
@@ -213,12 +213,12 @@ func makeDog() async {
|
||||
}
|
||||
|
||||
// NI-LABEL: sil hidden [ossa] @$s12initializers8makeBirbyyYaF : $@convention(thin) @async () -> () {
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: hop_to_executor [[BORROWED_EXEC:%.*]] : $MainActor
|
||||
// NI-NEXT: end_borrow [[BORROWED_EXEC]]
|
||||
// NI-NEXT: {{%[0-9]+}} = apply {{%[0-9]+}}({{%[0-9]+}}, {{%[0-9]+}}) : $@convention(method) (@owned String, @thin Birb.Type) -> Birb
|
||||
// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: } // end sil function '$s12initializers8makeBirbyyYaF'
|
||||
|
||||
// NI-NS-LABEL: sil hidden [ossa] @$s12initializers8makeBirbyyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>) -> () {
|
||||
@@ -238,7 +238,7 @@ actor SomeActor {
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s12initializers9SomeActorCACyYacfc : $@convention(method) @async (@sil_isolated @owned SomeActor) -> @owned SomeActor {
|
||||
// CHECK: bb0(%0 :
|
||||
// CHECK-NEXT: [[NIL_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK-NEXT: [[NIL_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[NIL_EXECUTOR]]
|
||||
init() async {}
|
||||
|
||||
@@ -260,10 +260,10 @@ func makeActor() async -> SomeActor {
|
||||
}
|
||||
|
||||
// NI-LABEL: sil hidden [ossa] @$s12initializers20makeActorFromGenericAA04SomeC0CyYaF : $@convention(thin) @async () -> @owned SomeActor {
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: apply
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: } // end sil function '$s12initializers20makeActorFromGenericAA04SomeC0CyYaF'
|
||||
|
||||
// NI-NS-LABEL: sil hidden [ossa] @$s12initializers20makeActorFromGenericAA04SomeC0CyYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>) -> @owned SomeActor {
|
||||
@@ -277,10 +277,10 @@ func makeActorFromGeneric() async -> SomeActor {
|
||||
}
|
||||
|
||||
// NI-LABEL: sil hidden [ossa] @$s12initializers26callActorMethodFromGeneric1ayAA04SomeC0C_tYaF :
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: apply
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: } // end sil function '$s12initializers26callActorMethodFromGeneric1ayAA04SomeC0C_tYaF'
|
||||
|
||||
// NI-NS-LABEL: sil hidden [ossa] @$s12initializers26callActorMethodFromGeneric1ayAA04SomeC0C_tYaF : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional<any Actor>, @guaranteed SomeActor) -> () {
|
||||
@@ -295,8 +295,8 @@ func callActorMethodFromGeneric(a: SomeActor) async {
|
||||
}
|
||||
|
||||
// NI-LABEL: sil hidden {{.*}} @$s12initializers15makeActorInTaskyyYaF : $@convention(thin) @async () -> () {
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: apply
|
||||
// NI: } // end sil function '$s12initializers15makeActorInTaskyyYaF'
|
||||
|
||||
@@ -307,17 +307,17 @@ func callActorMethodFromGeneric(a: SomeActor) async {
|
||||
// NI-NS: } // end sil function '$s12initializers15makeActorInTaskyyYaF'
|
||||
|
||||
// NI-LABEL: sil private [ossa] @$s12initializers15makeActorInTaskyyYaFAA04SomeC0CyYacfU_ : $@convention(thin) @async @substituted <τ_0_0> (@guaranteed Optional<any Actor>) -> @out τ_0_0 for <SomeActor> {
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: apply
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: } // end sil function '$s12initializers15makeActorInTaskyyYaFAA04SomeC0CyYacfU_'
|
||||
|
||||
// NI-NS-LABEL: sil private [ossa] @$s12initializers15makeActorInTaskyyYaFAA04SomeC0CyYacfU_ : $@convention(thin) @async @substituted <τ_0_0> (@guaranteed Optional<any Actor>) -> @out τ_0_0 for <SomeActor> {
|
||||
// NI-NS: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// NI-NS-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI-NS: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// NI-NS-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI-NS: apply
|
||||
// NI-NS-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI-NS-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI-NS: } // end sil function '$s12initializers15makeActorInTaskyyYaFAA04SomeC0CyYacfU_'
|
||||
@available(SwiftStdlib 5.1, *)
|
||||
func makeActorInTask() async {
|
||||
@@ -325,8 +325,8 @@ func makeActorInTask() async {
|
||||
}
|
||||
|
||||
// NI-LABEL: sil hidden {{.*}} @$s12initializers21callActorMethodInTask1ayAA04SomeC0C_tYaF : $@convention(thin) @async (@guaranteed SomeActor) -> () {
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// NI: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// NI-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// NI: apply
|
||||
// NI: } // end sil function '$s12initializers21callActorMethodInTask1ayAA04SomeC0C_tYaF'
|
||||
|
||||
@@ -336,10 +336,10 @@ func makeActorInTask() async {
|
||||
// NI-NS: } // end sil function '$s12initializers21callActorMethodInTask1ayAA04SomeC0C_tYaF'
|
||||
|
||||
// CHECK-LABEL: sil private [ossa] @$s12initializers21callActorMethodInTask1ayAA04SomeC0C_tYaFyyYacfU_ : $@convention(thin) @async @substituted <τ_0_0> (@guaranteed Optional<any Actor>, @guaranteed SomeActor) -> @out τ_0_0 for <()> {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// CHECK: apply
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
@available(SwiftStdlib 5.1, *)
|
||||
func callActorMethodInTask(a: SomeActor) async {
|
||||
Task.detached { await a.someMethod() }
|
||||
|
||||
@@ -38,9 +38,10 @@ struct S {
|
||||
|
||||
// DISABLED: sil hidden [ossa] @$s14execution_attr0A11CallerFieldyyAA1SVYaF : $@convention(thin) @async (@guaranteed S) -> () {
|
||||
// DISABLED: bb0([[ARG:%.*]] : @guaranteed $S):
|
||||
// DISABLED: [[ACTOR_NONE:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// DISABLED: hop_to_executor [[ACTOR_NONE]]
|
||||
// DISABLED: [[FIELD:%.*]] = struct_extract [[ARG]]
|
||||
// DISABLED: [[FIELD_COPY:%.*]] = copy_value [[FIELD]]
|
||||
// DISABLED: [[ACTOR_NONE:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// DISABLED: [[BORROWED_FIELD:%.*]] = begin_borrow [[FIELD_COPY]]
|
||||
// DISABLED: apply [[BORROWED_FIELD]]([[ACTOR_NONE]])
|
||||
// DISABLED: } // end sil function '$s14execution_attr0A11CallerFieldyyAA1SVYaF'
|
||||
@@ -65,7 +66,7 @@ extension S {
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s14execution_attr24testWithDynamicIsolation2fnyyyYAXE_tYaF : $@convention(thin) @async (@guaranteed @isolated(any) @noescape @callee_guaranteed () -> ()) -> () {
|
||||
// CHECK: bb0([[PARAM_FN:%.*]] : @guaranteed $@isolated(any) @noescape @callee_guaranteed () -> ()):
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]]
|
||||
// CHECK-NEXT: [[FN:%.*]] = copy_value [[PARAM_FN]]
|
||||
// CHECK-NEXT: [[BORROWED_FN:%.*]] = begin_borrow [[FN]]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test16unspecifiedAsyncyyYaF : $@convention(thin) @async () -> ()
|
||||
// CHECK: bb0:
|
||||
// CHECK-NEXT: [[GENERIC:%[0-9]+]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK-NEXT: [[GENERIC:%[0-9]+]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC]]
|
||||
// CHECK: } // end sil function '$s4test16unspecifiedAsyncyyYaF'
|
||||
func unspecifiedAsync() async {}
|
||||
@@ -13,7 +13,7 @@ actor MyActor {
|
||||
private var p: Int
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test7MyActorC6calleeyySiYaF : $@convention(method) @async (Int, @guaranteed MyActor) -> () {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: } // end sil function '$s4test7MyActorC6calleeyySiYaF'
|
||||
nonisolated func callee(_ x: Int) async {
|
||||
@@ -21,7 +21,7 @@ actor MyActor {
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test7MyActorC14throwingCalleeyySiYaKF : $@convention(method) @async (Int, @guaranteed MyActor) -> @error any Error {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: } // end sil function '$s4test7MyActorC14throwingCalleeyySiYaKF'
|
||||
nonisolated func throwingCallee(_ x: Int) async throws {
|
||||
@@ -283,7 +283,7 @@ struct BlueActor {
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test20unspecifiedAsyncFuncyyYaF : $@convention(thin) @async () -> () {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: [[BORROW:%[0-9]+]] = begin_borrow {{%[0-9]+}} : $RedActorImpl
|
||||
// CHECK-NEXT: hop_to_executor [[BORROW]] : $RedActorImpl
|
||||
@@ -298,7 +298,7 @@ func unspecifiedAsyncFunc() async {
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test27anotherUnspecifiedAsyncFuncyyAA12RedActorImplCYaF : $@convention(thin) @async (@guaranteed RedActorImpl) -> () {
|
||||
// CHECK: bb0([[RED:%[0-9]+]] : @guaranteed $RedActorImpl):
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: [[INTARG:%[0-9]+]] = apply {{%[0-9]+}}({{%[0-9]+}}, {{%[0-9]+}}) : $@convention(method) (Builtin.IntLiteral, @thin Int.Type) -> Int
|
||||
// CHECK: [[METH:%[0-9]+]] = class_method [[RED]] : $RedActorImpl, #RedActorImpl.hello : (isolated RedActorImpl) -> (Int) -> (), $@convention(method) (Int, @sil_isolated @guaranteed RedActorImpl) -> ()
|
||||
@@ -311,14 +311,14 @@ func anotherUnspecifiedAsyncFunc(_ red : RedActorImpl) async {
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test0A20GlobalActorFuncValueyyyyAA03RedC0VYcXEYaF
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: function_ref @$s4test8RedActorV6sharedAA0bC4ImplCvgZ
|
||||
// CHECK: hop_to_executor [[RED:%[0-9]+]] : $RedActorImpl
|
||||
// CHECK-NEXT: end_borrow [[RED]]
|
||||
// CHECK-NEXT: begin_borrow
|
||||
// CHECK-NEXT: apply
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC:%[0-9]+]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC:%[0-9]+]] : $Optional<any Actor>
|
||||
func testGlobalActorFuncValue(_ fn: @RedActor () -> Void) async {
|
||||
await fn()
|
||||
}
|
||||
@@ -482,18 +482,18 @@ extension MyActor {
|
||||
func testImplicitAsyncIsolatedParam(
|
||||
i: Int, d: Double, actor: MyActor, otherActor: MyActor
|
||||
) async {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: [[FN1:%.*]] = function_ref @$s4test19acceptIsolatedParamyySi_AA7MyActorCYiSdtF
|
||||
// CHECK-NEXT: hop_to_executor [[ACTOR:%.*]] : $MyActor
|
||||
// CHECK-NEXT: apply [[FN1]](%0, %2, %1) : $@convention(thin) (Int, @sil_isolated @guaranteed MyActor, Double) -> ()
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
await acceptIsolatedParam(i, actor, d)
|
||||
|
||||
// CHECK: [[FN2:%.*]] = function_ref @$s4test7MyActorC13otherIsolatedyySi_ACYiSdtF : $@convention(method) (Int, @sil_isolated @guaranteed MyActor, Double, @guaranteed MyActor) -> ()
|
||||
// CHECK-NEXT: hop_to_executor [[ACTOR:%.*]] : $MyActor
|
||||
// CHECK-NEXT: apply [[FN2]](%0, %2, %1, %3) : $@convention(method) (Int, @sil_isolated @guaranteed MyActor, Double, @guaranteed MyActor) -> ()
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
await otherActor.otherIsolated(i, actor, d)
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ struct GlobalCat {
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test015accessSweaterOfC03catAA0C0VAA3CatC_tYaF : $@convention(thin) @async (@guaranteed Cat) -> @owned Sweater {
|
||||
// CHECK: bb0([[CAT:%[0-9]+]] : @guaranteed $Cat):
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: [[CAT_GETTER:%[0-9]+]] = class_method [[CAT]] : $Cat, #Cat.computedSweater!getter : (isolated Cat) -> () -> Sweater, $@convention(method) (@sil_isolated @guaranteed Cat) -> @owned Sweater
|
||||
// CHECK: hop_to_executor [[CAT]] : $Cat
|
||||
@@ -110,7 +110,7 @@ func accessSweaterOfSweater(cat : Cat) async -> Sweater {
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test26accessGlobalIsolatedMember3catSSAA3CatC_tYaF : $@convention(thin) @async (@guaranteed Cat) -> @owned String {
|
||||
// CHECK: bb0([[CAT:%[0-9]+]] : @guaranteed $Cat):
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
|
||||
// CHECK: [[GETTER:%[0-9]+]] = class_method [[CAT]] : $Cat, #Cat.leader!getter : (Cat) -> () -> String, $@convention(method) (@guaranteed Cat) -> @owned String
|
||||
@@ -443,21 +443,21 @@ struct Container {
|
||||
@GlobalCat var isoRef: CatBox = CatBox()
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV12accessTuple1SfyYaF : $@convention(method) @async (@guaranteed Container) -> Float {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $MainActor
|
||||
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*(Optional<(Int, Int)>, Float)
|
||||
// CHECK: [[ADDR:%[0-9]+]] = tuple_element_addr [[ACCESS]] : $*(Optional<(Int, Int)>, Float), 1
|
||||
// CHECK: {{%[0-9]+}} = load [trivial] [[ADDR]] : $*Float
|
||||
// CHECK: end_access [[ACCESS]] : $*(Optional<(Int, Int)>, Float)
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// CHECK: } // end sil function '$s4test9ContainerV12accessTuple1SfyYaF'
|
||||
func accessTuple1() async -> Float {
|
||||
return await globalCircle.1
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV12accessTuple2SiSgyYaFZ : $@convention(method) @async (@thin Container.Type) -> Optional<Int> {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $MainActor
|
||||
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*(Optional<(Int, Int)>, Float)
|
||||
@@ -473,37 +473,37 @@ struct Container {
|
||||
// CHECK: [[ELM_ADDR:%[0-9]+]] = tuple_element_addr [[TUPLE_ADDR]] : $*(Int, Int), 0
|
||||
// CHECK: {{%[0-9]+}} = load [trivial] [[ELM_ADDR]] : $*Int
|
||||
// CHECK: end_access [[ACCESS]] : $*(Optional<(Int, Int)>, Float)
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// CHECK: } // end sil function '$s4test9ContainerV12accessTuple2SiSgyYaFZ'
|
||||
static func accessTuple2() async -> Int? {
|
||||
return await globalCircle.0!.0
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV12accessTuple3SfyYaF : $@convention(method) @async (@guaranteed Container) -> Float {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV12staticCircleSi_SitSg_Sftvau : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $MainActor
|
||||
// CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $MainActor
|
||||
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*(Optional<(Int, Int)>, Float)
|
||||
// CHECK: [[ADDR:%[0-9]+]] = tuple_element_addr [[ACCESS]] : $*(Optional<(Int, Int)>, Float), 1
|
||||
// CHECK: {{%[0-9]+}} = load [trivial] [[ADDR]] : $*Float
|
||||
// CHECK: end_access [[ACCESS]] : $*(Optional<(Int, Int)>, Float)
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// CHECK: } // end sil function '$s4test9ContainerV12accessTuple3SfyYaF'
|
||||
func accessTuple3() async -> Float {
|
||||
return await Container.staticCircle.1
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV12accessTuple4SiSgyYaFZ : $@convention(method) @async (@thin Container.Type) -> Optional<Int> {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV12staticCircleSi_SitSg_Sftvau : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $MainActor
|
||||
// CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $MainActor
|
||||
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*(Optional<(Int, Int)>, Float)
|
||||
// CHECK: [[ADDR:%[0-9]+]] = tuple_element_addr [[ACCESS]] : $*(Optional<(Int, Int)>, Float), 0
|
||||
@@ -518,7 +518,7 @@ struct Container {
|
||||
// CHECK: [[ELM_ADDR:%[0-9]+]] = tuple_element_addr [[TUPLE_ADDR]] : $*(Int, Int), 0
|
||||
// CHECK: {{%[0-9]+}} = load [trivial] [[ELM_ADDR]] : $*Int
|
||||
// CHECK: end_access [[ACCESS]] : $*(Optional<(Int, Int)>, Float)
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// CHECK: } // end sil function '$s4test9ContainerV12accessTuple4SiSgyYaFZ'
|
||||
static func accessTuple4() async -> Int? {
|
||||
return await Container.staticCircle.0!.0
|
||||
@@ -526,16 +526,16 @@ struct Container {
|
||||
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV8getCountSiyYaFZ : $@convention(method) @async (@thin Container.Type) -> Int {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV7counterSivau : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $MainActor
|
||||
// CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $MainActor
|
||||
// CHECK: {{%[0-9]+}} = begin_access [read] [dynamic] {{%[0-9]+}} : $*Int
|
||||
// CHECK: {{%[0-9]+}} = load [trivial] {{%[0-9]+}} : $*Int
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// CHECK: } // end sil function '$s4test9ContainerV8getCountSiyYaFZ'
|
||||
static func getCount() async -> Int {
|
||||
return await counter
|
||||
@@ -544,12 +544,12 @@ struct Container {
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV8getValueSiSgyYaFZ : $@convention(method) @async (@thin Container.Type) -> Optional<Int> {
|
||||
// CHECK: bb0(%0 : $@thin Container.Type):
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV4thisACSgvau : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $MainActor
|
||||
// CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $Optional<any Actor>
|
||||
// CHECK: [[MAIN:%[0-9]+]] = begin_borrow {{%[0-9]+}} : $MainActor
|
||||
// CHECK: hop_to_executor [[MAIN]] : $MainActor
|
||||
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*Optional<Container>
|
||||
@@ -558,11 +558,11 @@ struct Container {
|
||||
// CHECK: [[TRUE_BB]]:
|
||||
// CHECK: {{%[0-9]+}} = load [trivial] {{%[0-9]+}} : $*Int
|
||||
// CHECK: end_access [[ACCESS]] : $*Optional<Container>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
//
|
||||
// CHECK: [[FALSE_BB]]:
|
||||
// CHECK: end_access [[ACCESS]] : $*Optional<Container>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
//
|
||||
// CHECK: } // end sil function '$s4test9ContainerV8getValueSiSgyYaFZ'
|
||||
static func getValue() async -> Int? {
|
||||
@@ -571,12 +571,12 @@ struct Container {
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV10getOrCrashSfyYaFZ : $@convention(method) @async (@thin Container.Type) -> Float {
|
||||
// CHECK: bb0({{%[0-9]+}} : $@thin Container.Type):
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV4thisACSgvau : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $MainActor
|
||||
// CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// CHECK: hop_to_executor {{%.*}} : $MainActor
|
||||
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*Optional<Container>
|
||||
// CHECK: switch_enum_addr [[ACCESS]] : $*Optional<Container>, case #Optional.some!enumelt: [[SOME_BB:bb[0-9]+]], case #Optional.none!enumelt: [[CRASH_BB:bb[0-9]+]]
|
||||
@@ -597,12 +597,12 @@ struct Container {
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test9ContainerV13getRefOrCrashAA6CatBoxCyYaFZ : $@convention(method) @async (@thin Container.Type) -> @owned CatBox {
|
||||
// CHECK: bb0({{%[0-9]+}} : $@thin Container.Type):
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: [[ADDRESS_ACCESSOR:%[0-9]+]] = function_ref @$s4test9ContainerV4thisACSgvau : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $MainActor
|
||||
// CHECK: = apply [[ADDRESS_ACCESSOR]]() : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// CHECK: hop_to_executor {{%.*}} : $MainActor
|
||||
// CHECK: [[ACCESS:%[0-9]+]] = begin_access [read] [dynamic] {{%[0-9]+}} : $*Optional<Container>
|
||||
// CHECK: switch_enum_addr [[ACCESS]] : $*Optional<Container>, case #Optional.some!enumelt: [[SOME_BB:bb[0-9]+]], case #Optional.none!enumelt: [[CRASH_BB:bb[0-9]+]]
|
||||
@@ -642,18 +642,18 @@ struct Blah {
|
||||
|
||||
// closure #1 in Blah.test()
|
||||
// CHECK-LABEL: sil private [ossa] @$s4test4BlahVAAyyFyyYacfU_ : $@convention(thin) @async @substituted <τ_0_0> (@guaranteed Optional<any Actor>, Blah) -> @out τ_0_0 for <()> {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $MainActor
|
||||
// CHECK: [[ACTOR_OBJ_RAW:%[0-9]+]] = apply {{%[0-9]+}}({{%[0-9]+}}) : $@convention(method) (Blah) -> @owned Coordinator
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{%[0-9]+}} : $Optional<any Actor>
|
||||
// CHECK: [[ACTOR_OBJ:%[0-9]+]] = begin_borrow [[ACTOR_OBJ_RAW]] : $Coordinator
|
||||
// CHECK: [[VAL:%[0-9]+]] = ref_element_addr [[ACTOR_OBJ]] : $Coordinator, #Coordinator.someValue
|
||||
// CHECK: hop_to_executor [[ACTOR_OBJ]]
|
||||
// CHECK: [[VAL_ACCESS:%[0-9]+]] = begin_access [read] [dynamic] [[VAL]] : $*Optional<Int>
|
||||
// CHECK: {{%[0-9]+}} = load [trivial] [[VAL_ACCESS]] : $*Optional<Int>
|
||||
// CHECK: end_access [[VAL_ACCESS]] : $*Optional<Int>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
// CHECK: } // end sil function '$s4test4BlahVAAyyFyyYacfU_'
|
||||
@available(SwiftStdlib 5.1, *)
|
||||
func test() {
|
||||
@@ -677,16 +677,16 @@ class Polar {
|
||||
|
||||
|
||||
// CHECK-LABEL: sil hidden{{.*}} @$s4test20accessStaticIsolatedSiyYaF : $@convention(thin) @async () -> Int {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: [[ADDRESSOR:%[0-9]+]] = function_ref @$s4test5PolarC11temperatureSivau : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK: hop_to_executor {{%.*}} : $MainActor
|
||||
// CHECK-NEXT: [[RAW_ADDR:%[0-9]+]] = apply [[ADDRESSOR]]() : $@convention(thin) () -> Builtin.RawPointer
|
||||
// CHECK-NEXT: hop_to_executor {{%.*}} : $Optional<Builtin.Executor>
|
||||
// CHECK-NEXT: hop_to_executor {{%.*}} : $Optional<any Actor>
|
||||
// CHECK: [[ADDR:%[0-9]+]] = pointer_to_address [[RAW_ADDR]] : $Builtin.RawPointer to [strict] $*Int
|
||||
// CHECK: hop_to_executor {{%.*}} : $MainActor
|
||||
// CHECK: {{%.*}} = load [trivial] {{%.*}} : $*Int
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] : $Optional<any Actor>
|
||||
func accessStaticIsolated() async -> Int {
|
||||
return await Polar.temperature
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// REQUIRES: asserts
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test8callSync2fnyyyYbYAXE_tYaF
|
||||
// CHECK: [[NIL_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[NIL_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[NIL_EXECUTOR]]
|
||||
// CHECK-NEXT: [[FN_COPY:%.*]] = copy_value %0 : $@isolated(any) @noescape @Sendable @callee_guaranteed () -> ()
|
||||
// CHECK-NEXT: [[FN_BORROW1:%.*]] = begin_borrow [[FN_COPY]] :
|
||||
@@ -19,7 +19,7 @@ func callSync(fn: @isolated(any) @Sendable () -> ()) async {
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s4test9callAsync2fnyyyYaYbYAXE_tYaF
|
||||
// CHECK: [[NIL_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[NIL_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[NIL_EXECUTOR]]
|
||||
// CHECK-NEXT: [[FN_COPY:%.*]] = copy_value %0 : $@isolated(any) @noescape @Sendable @async @callee_guaranteed () -> ()
|
||||
// CHECK-NEXT: [[FN_BORROW2:%.*]] = begin_borrow [[FN_COPY]] :
|
||||
|
||||
@@ -255,7 +255,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String {
|
||||
// rdar://91502776
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s{{.*}}21checkCostcoMembershipSbyYaF : $@convention(thin) @async () -> Bool {
|
||||
// CHECK: bb0:
|
||||
// CHECK: hop_to_executor {{%.*}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{%.*}} : $Optional<any Actor>
|
||||
// CHECK: [[FINAL_BUF:%.*]] = alloc_stack $Bool
|
||||
// CHECK: [[RESULT_BUF:%.*]] = alloc_stack $NSObject
|
||||
// CHECK: [[METH:%.*]] = objc_method {{%.*}} : $@objc_metatype Person.Type, #Person.asCustomer!foreign
|
||||
@@ -264,7 +264,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String {
|
||||
// CHECK: dealloc_stack {{%.*}} : $*@block_storage
|
||||
// CHECK: await_async_continuation {{%.*}} : $Builtin.RawUnsafeContinuation, resume bb1
|
||||
// CHECK: bb1:
|
||||
// CHECK: hop_to_executor {{%.*}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{%.*}} : $Optional<any Actor>
|
||||
// CHECK: [[RESULT:%.*]] = load [take] [[RESULT_BUF]] : $*NSObject
|
||||
// CHECK: objc_method {{%.*}} : $CostcoManager, #CostcoManager.isCustomerEnrolled!foreign
|
||||
// CHECK: get_async_continuation_addr Bool, [[FINAL_BUF]] : $*Bool
|
||||
@@ -275,7 +275,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String {
|
||||
// CHECK: dealloc_stack [[BLOCK_STORAGE]] : $*@block_storage
|
||||
// CHECK: await_async_continuation {{%.*}} : $Builtin.RawUnsafeContinuation, resume bb2
|
||||
// CHECK: bb2:
|
||||
// CHECK: hop_to_executor {{%.*}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{%.*}} : $Optional<any Actor>
|
||||
// CHECK: [[ANSWER:%.*]] = load [trivial] [[FINAL_BUF]] : $*Bool
|
||||
// CHECK: fix_lifetime [[EXTEND2]] : $CostcoManager
|
||||
// CHECK: destroy_value [[EXTEND2]] : $CostcoManager
|
||||
@@ -325,7 +325,7 @@ extension OptionalMemberLookups {
|
||||
// CHECK: destroy_value {{.*}} : $MainActor
|
||||
// CHECK: dealloc_stack {{.*}} : $*AutoreleasingUnsafeMutablePointer<Optional<NSError>>
|
||||
// CHECK: dealloc_stack {{.*}} : $*@sil_unmanaged Optional<NSError>
|
||||
// CHECK: hop_to_executor {{.*}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{.*}} : $Optional<any Actor>
|
||||
// CHECK: switch_enum
|
||||
func checkHotdogs(_ v: some HotdogCompetitor, _ timeLimit: NSObject) async throws -> String? {
|
||||
return try await v.pileOfHotdogsToEat(withLimit: timeLimit)
|
||||
|
||||
@@ -306,7 +306,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String {
|
||||
// rdar://91502776
|
||||
// CHECK-LABEL: sil hidden [ossa] @$s{{.*}}21checkCostcoMembershipSbyYaF : $@convention(thin) @async () -> Bool {
|
||||
// CHECK: bb0:
|
||||
// CHECK: hop_to_executor {{%.*}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{%.*}} : $Optional<any Actor>
|
||||
// CHECK: [[FINAL_BUF:%.*]] = alloc_stack $Bool
|
||||
// CHECK: [[RESULT_BUF:%.*]] = alloc_stack $NSObject
|
||||
// CHECK: [[METH:%.*]] = objc_method {{%.*}} : $@objc_metatype Person.Type, #Person.asCustomer!foreign
|
||||
@@ -317,7 +317,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String {
|
||||
// CHECK: dealloc_stack {{%.*}} : $*@block_storage
|
||||
// CHECK: await_async_continuation {{%.*}} : $Builtin.RawUnsafeContinuation, resume bb1
|
||||
// CHECK: bb1:
|
||||
// CHECK: hop_to_executor {{%.*}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{%.*}} : $Optional<any Actor>
|
||||
// CHECK: [[RESULT:%.*]] = load [take] [[RESULT_BUF]] : $*NSObject
|
||||
// CHECK: objc_method {{%.*}} : $CostcoManager, #CostcoManager.isCustomerEnrolled!foreign
|
||||
// CHECK: get_async_continuation_addr Bool, [[FINAL_BUF]] : $*Bool
|
||||
@@ -328,7 +328,7 @@ func testThrowingMethodFromMain(slowServer: SlowServer) async -> String {
|
||||
// CHECK: dealloc_stack [[BLOCK_STORAGE]] : $*@block_storage
|
||||
// CHECK: await_async_continuation {{%.*}} : $Builtin.RawUnsafeContinuation, resume bb2
|
||||
// CHECK: bb2:
|
||||
// CHECK: hop_to_executor {{%.*}} : $Optional<Builtin.Executor>
|
||||
// CHECK: hop_to_executor {{%.*}} : $Optional<any Actor>
|
||||
// CHECK: [[ANSWER:%.*]] = load [trivial] [[FINAL_BUF]] : $*Bool
|
||||
// CHECK: fix_lifetime [[EXTEND2]] : $CostcoManager
|
||||
// CHECK: destroy_value [[EXTEND2]] : $CostcoManager
|
||||
|
||||
@@ -20,7 +20,7 @@ import ObjCConcurrency
|
||||
// CHECK-LABEL: sil {{.*}}@{{.*}}15testSlowServing
|
||||
func testSlowServing(p: SlowServing) async throws {
|
||||
// CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional<any Actor>,
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[HOP_TARGET]] :
|
||||
// CHECK: objc_method {{.*}} $@convention(objc_method) <τ_0_0 where τ_0_0 : SlowServing> (@convention(block) (Int) -> (), τ_0_0) -> ()
|
||||
// CHECK: hop_to_executor [[HOP_TARGET]] :
|
||||
@@ -44,7 +44,7 @@ func testSlowServing(p: SlowServing) async throws {
|
||||
// CHECK-LABEL: sil {{.*}}@{{.*}}20testSlowServingAgain
|
||||
func testSlowServingAgain(p: SlowServing) async throws {
|
||||
// CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional<any Actor>,
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[HOP_TARGET]] :
|
||||
// CHECK: objc_method {{.*}} $@convention(objc_method) <τ_0_0 where τ_0_0 : SlowServing> (@convention(block) (Optional<NSString>, Optional<NSError>) -> (), τ_0_0) -> ()
|
||||
// CHECK: hop_to_executor [[HOP_TARGET]] :
|
||||
@@ -56,7 +56,7 @@ func testSlowServingAgain(p: SlowServing) async throws {
|
||||
class SlowSwiftServer: NSObject, SlowServing {
|
||||
// CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC10requestIntSiyYaF
|
||||
// CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional<any Actor>,
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[HOP_TARGET]] :
|
||||
// CHECK: } // end sil function '$s21objc_async_from_swift15SlowSwiftServerC10requestIntSiyYaF{{.*}}'
|
||||
// CHECK-LABEL: sil private {{.*}} @${{.*}}10requestInt{{.*}}To :
|
||||
@@ -75,11 +75,11 @@ class SlowSwiftServer: NSObject, SlowServing {
|
||||
func requestString() async -> String { return "" }
|
||||
// CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC13requestStringSSyYaF
|
||||
// CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional<any Actor>,
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[HOP_TARGET]] :
|
||||
// CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC16tryRequestStringSSyYaKF
|
||||
// CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional<any Actor>,
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[HOP_TARGET]] :
|
||||
// CHECK-LABEL: sil shared {{.*}} @${{.*}}16tryRequestString{{.*}}U_To :
|
||||
// CHECK: [[BLOCK_COPY:%.*]] = copy_block %0
|
||||
@@ -96,13 +96,13 @@ class SlowSwiftServer: NSObject, SlowServing {
|
||||
|
||||
// CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC19requestIntAndStringSi_SStyYaF
|
||||
// CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional<any Actor>,
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[HOP_TARGET]] :
|
||||
func requestIntAndString() async -> (Int, String) { return (0, "") }
|
||||
|
||||
// CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC22tryRequestIntAndStringSi_SStyYaKF
|
||||
// CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional<any Actor>,
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[HOP_TARGET]] :
|
||||
func tryRequestIntAndString() async throws -> (Int, String) { return (0, "") }
|
||||
}
|
||||
@@ -205,7 +205,7 @@ class SlowServerlet: SlowServer {
|
||||
//
|
||||
// CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> Int
|
||||
// CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional<any Actor>
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-C: hop_to_executor [[ACTOR]]
|
||||
// CHECK-C: // end sil function '$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF'
|
||||
|
||||
@@ -236,7 +236,7 @@ class SlowServerlet: SlowServer {
|
||||
//
|
||||
// CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> @owned String
|
||||
// CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional<any Actor>
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-C-NEXT: hop_to_executor [[ACTOR]]
|
||||
// CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF'
|
||||
|
||||
@@ -263,7 +263,7 @@ class SlowServerlet: SlowServer {
|
||||
//
|
||||
// CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> (@owned String, @error any Error)
|
||||
// CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional<any Actor>,
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-C-NEXT: hop_to_executor [[ACTOR]]
|
||||
// CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF'
|
||||
|
||||
@@ -291,7 +291,7 @@ class SlowServerlet: SlowServer {
|
||||
//
|
||||
// CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error)
|
||||
// CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional<any Actor>,
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-C-NEXT: hop_to_executor [[ACTOR]]
|
||||
// CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF'
|
||||
|
||||
@@ -317,7 +317,7 @@ class SlowServerlet: SlowServer {
|
||||
//
|
||||
// CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error)
|
||||
// CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional<any Actor>,
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-C-NEXT: hop_to_executor [[ACTOR]]
|
||||
// CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF'
|
||||
|
||||
@@ -349,7 +349,7 @@ class SlowServerlet: SlowServer {
|
||||
//
|
||||
// CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error)
|
||||
// CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional<any Actor>,
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-C-NEXT: hop_to_executor [[ACTOR]]
|
||||
// CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF'
|
||||
//
|
||||
@@ -380,7 +380,7 @@ class SlowServerlet: SlowServer {
|
||||
//
|
||||
// CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @owned String, @error any Error)
|
||||
// CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional<any Actor>,
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK-C: [[ACTOR:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-C-NEXT: hop_to_executor [[ACTOR]]
|
||||
// CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF'
|
||||
//
|
||||
@@ -561,7 +561,7 @@ func testAutoclosureInStaticMethod() {
|
||||
//
|
||||
// CHECK-C-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ : $@convention(method) @async (@guaranteed String, @guaranteed @noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), @thick TestKlass.Type) -> @owned Optional<String> {
|
||||
// CHECK-C: bb0([[STRING:%.*]] : @guaranteed $String, [[COMPLETION:%.*]] : @guaranteed $@noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), [[METATYPE:%.*]] : $@thick TestKlass.Type)
|
||||
// CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-C: hop_to_executor [[EXEC_NONE]]
|
||||
// CHECK-C: hop_to_executor [[EXEC_NONE]]
|
||||
// CHECK-C: hop_to_executor [[EXEC_NONE]]
|
||||
@@ -693,7 +693,7 @@ func testAutoclosureInStaticMethod() {
|
||||
//
|
||||
// CHECK-C-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ : $@convention(method) @async (@guaranteed String, @guaranteed @noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), @thick TestKlass.Type) -> @owned Optional<String> {
|
||||
// CHECK-C: bb0([[STRING:%.*]] : @guaranteed $String, [[COMPLETION:%.*]] : @guaranteed $@noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), [[METATYPE:%.*]] : $@thick TestKlass.Type)
|
||||
// CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-C: hop_to_executor [[EXEC_NONE]]
|
||||
// CHECK-C: hop_to_executor [[EXEC_NONE]]
|
||||
// CHECK-C: hop_to_executor [[EXEC_NONE]]
|
||||
|
||||
@@ -52,7 +52,7 @@ func testAsyncThrows(eff : EffProps) async {
|
||||
|
||||
// CHECK-LABEL: sil {{.*}}@${{.*}}17testMainActorProp
|
||||
func testMainActorProp(eff : EffProps) async {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: } // end sil function '${{.*}}17testMainActorProp
|
||||
@@ -61,7 +61,7 @@ func testMainActorProp(eff : EffProps) async {
|
||||
|
||||
// CHECK-LABEL: sil {{.*}}@${{.*}}19testMainActorMethod
|
||||
func testMainActorMethod(eff : EffProps) async {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: } // end sil function '${{.*}}19testMainActorMethod
|
||||
|
||||
@@ -62,7 +62,7 @@ func testAsyncThrows(eff : EffProps) async {
|
||||
|
||||
// CHECK-LABEL: sil {{.*}}@${{.*}}17testMainActorProp
|
||||
func testMainActorProp(eff : EffProps) async {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: } // end sil function '${{.*}}17testMainActorProp
|
||||
@@ -71,7 +71,7 @@ func testMainActorProp(eff : EffProps) async {
|
||||
|
||||
// CHECK-LABEL: sil {{.*}}@${{.*}}19testMainActorMethod
|
||||
func testMainActorMethod(eff : EffProps) async {
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXEC:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: hop_to_executor [[GENERIC_EXEC]] :
|
||||
// CHECK: } // end sil function '${{.*}}19testMainActorMethod
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// CHECK-LABEL: sil [ossa] @async_dead_arg_call : {{.*}} {
|
||||
// CHECK: {{bb[0-9]+}}([[INSTANCE:%[^,]+]] : @noImplicitCopy @_eagerMove @owned
|
||||
// CHECK: destroy_value [[INSTANCE]]
|
||||
// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK: [[CALLEE:%[^,]+]] = function_ref @async_callee
|
||||
// CHECK: apply [[CALLEE]]()
|
||||
// CHECK: hop_to_executor [[EXECUTOR]]
|
||||
@@ -18,7 +18,7 @@ public func async_dead_arg_call(o: consuming AnyObject) async {
|
||||
|
||||
// CHECK-LABEL: sil [ossa] @async_dead_arg_call_lexical : {{.*}} {
|
||||
// CHECK: {{bb[0-9]+}}([[INSTANCE:%[^,]+]] : @noImplicitCopy @_lexical @owned
|
||||
// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK: [[CALLEE:%[^,]+]] = function_ref @async_callee
|
||||
// CHECK: apply [[CALLEE]]()
|
||||
// CHECK: hop_to_executor [[EXECUTOR]]
|
||||
@@ -47,7 +47,7 @@ public class C {
|
||||
// CHECK-LABEL: sil [ossa] @async_dead_arg_call_method : {{.*}} {
|
||||
// CHECK: {{bb[0-9]+}}([[INSTANCE:%[^,]+]] : @noImplicitCopy @_eagerMove @owned
|
||||
// CHECK: destroy_value [[INSTANCE]]
|
||||
// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK: [[CALLEE:%[^,]+]] = function_ref @async_callee : $@convention(thin) @async () -> ()
|
||||
// CHECK: apply [[CALLEE]]() : $@convention(thin) @async () -> ()
|
||||
// CHECK: hop_to_executor [[EXECUTOR]]
|
||||
|
||||
@@ -79,7 +79,7 @@ actor BoringActor {
|
||||
// CHECK: bb0([[SELF:%[0-9]+]] : $SingleVarActor):
|
||||
// TODO: We should be able to eliminate this by reasoning that the stores
|
||||
// are to local memory.
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
// CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]]
|
||||
// CHECK: store {{%[0-9]+}} to [[ACCESS:%[0-9]+]]
|
||||
@@ -96,7 +96,7 @@ actor BoringActor {
|
||||
// CHECK: bb0({{%[0-9]+}} : $Int, [[SELF:%[0-9]+]] : $SingleVarActor):
|
||||
// TODO: We should be able to eliminate this by reasoning that the stores
|
||||
// are to local memory.
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
// CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]]
|
||||
// CHECK: [[MYVAR_REF:%[0-9]+]] = ref_element_addr [[EI]] : $SingleVarActor, #SingleVarActor.myVar
|
||||
@@ -118,7 +118,7 @@ actor BoringActor {
|
||||
|
||||
// TODO: We should be able to eliminate this by reasoning that the stores
|
||||
// are to local memory.
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
|
||||
// CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]]
|
||||
@@ -150,7 +150,7 @@ actor BoringActor {
|
||||
|
||||
// TODO: We should be able to eliminate this by reasoning that the stores
|
||||
// are to local memory.
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
|
||||
// CHECK: cond_br {{%[0-9]+}}, [[SUCCESS_BB:bb[0-9]+]], {{bb[0-9]+}}
|
||||
@@ -170,7 +170,7 @@ actor BoringActor {
|
||||
// CHECK: [[SELF_ALLOC:%[0-9]+]] = alloc_stack [lexical] [var_decl] $SingleVarActor, let, name "self"
|
||||
|
||||
// Initial hop to the generic executor.
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
|
||||
// Hop immediately after the call to the synchronous init.
|
||||
@@ -219,7 +219,7 @@ actor DefaultInit {
|
||||
// CHECK: bb0([[SELF:%[0-9]+]] : $DefaultInit):
|
||||
// Initial hop to the generic executor.
|
||||
// TODO: This should be easy to remove.
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
// CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]]
|
||||
// CHECK: store {{%[0-9]+}} to {{%[0-9]+}} : $*ActingError<Int>
|
||||
@@ -231,7 +231,7 @@ actor DefaultInit {
|
||||
// CHECK: bb0({{%[0-9]+}} : $Bool, [[SELF:%[0-9]+]] : $DefaultInit):
|
||||
// Initial hop to the generic executor.
|
||||
// TODO: This should be fairly easy to remove.
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
// CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]]
|
||||
// CHECK: store {{%[0-9]+}} to {{%[0-9]+}} : $*ActingError<Int>
|
||||
@@ -253,7 +253,7 @@ actor MultiVarActor {
|
||||
// CHECK: bb0({{%[0-9]+}} : $Bool, [[SELF:%[0-9]+]] : $MultiVarActor):
|
||||
// Initial hop to the generic executor.
|
||||
// TODO: This should be easy to remove.
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
// CHECK: [[EI:%.*]] = end_init_let_ref [[SELF]]
|
||||
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[EI]] : $MultiVarActor, #MultiVarActor.firstVar
|
||||
@@ -271,7 +271,7 @@ actor MultiVarActor {
|
||||
// CHECK-LABEL: sil hidden @$s4test13MultiVarActorC10noSuccCaseACSb_tYacfc : $@convention(method) @async (Bool, @sil_isolated @owned MultiVarActor) -> @owned MultiVarActor {
|
||||
// Initial hop to the generic executor.
|
||||
// TODO: This should be easy to remove.
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
|
||||
// CHECK: store {{%[0-9]+}} to [[A1:%[0-9]+]] : $*Int
|
||||
@@ -293,7 +293,7 @@ actor MultiVarActor {
|
||||
// CHECK-LABEL: sil hidden @$s4test13MultiVarActorC10noPredCaseACSb_tYacfc : $@convention(method) @async (Bool, @sil_isolated @owned MultiVarActor) -> @owned MultiVarActor {
|
||||
// Initial hop to the generic executor.
|
||||
// TODO: This should be easy to remove.
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
|
||||
// CHECK: store {{%[0-9]+}} to [[ACCESS:%[0-9]+]] : $*Int
|
||||
@@ -316,7 +316,7 @@ actor MultiVarActor {
|
||||
// TODO: We should be able to remove this hop by proving that all the
|
||||
// stores before return are local. We don't really care about invalid
|
||||
// code, of course, but it should fall out.
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
init?(doesNotFullyInit1: Bool) async {
|
||||
firstVar = 1
|
||||
@@ -324,7 +324,7 @@ actor MultiVarActor {
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil hidden @$s4test13MultiVarActorC17doesNotFullyInit2ACSb_tYacfc
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
init(doesNotFullyInit2: Bool) async {
|
||||
firstVar = 1
|
||||
@@ -332,7 +332,7 @@ actor MultiVarActor {
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil hidden @$s4test13MultiVarActorC17doesNotFullyInit3ACSb_tYaKcfc
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
init(doesNotFullyInit3: Bool) async throws {
|
||||
firstVar = 1
|
||||
@@ -340,7 +340,7 @@ actor MultiVarActor {
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil hidden @$s4test13MultiVarActorC17doesNotFullyInit4ACSgSb_tYacfc
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
init?(doesNotFullyInit4: Bool) async {
|
||||
firstVar = 1
|
||||
@@ -358,7 +358,7 @@ actor TaskMaster {
|
||||
// CHECK-LABEL: @$s4test10TaskMasterCACyYacfc : $@convention(method) @async (@sil_isolated @owned TaskMaster) -> @owned TaskMaster {
|
||||
// Initial hop to the generic executor.
|
||||
// TODO: This should be easy to remove.
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
|
||||
// CHECK: [[ELM:%[0-9]+]] = ref_element_addr [[SELF:%[0-9]+]] : $TaskMaster, #TaskMaster.task
|
||||
@@ -382,7 +382,7 @@ actor SomeActor {
|
||||
// CHECK-LABEL: sil hidden @$s4test9SomeActorCACyYacfc : $@convention(method) @async (@sil_isolated @owned SomeActor) -> @owned SomeActor {
|
||||
// Initial hop to the generic executor.
|
||||
// TODO: This should be easy to remove.
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<Builtin.Executor>, #Optional.none
|
||||
// CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional<any Actor>, #Optional.none
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC_EXECUTOR]]
|
||||
|
||||
// CHECK-NOT: begin_access
|
||||
@@ -397,7 +397,7 @@ actor Ahmad {
|
||||
|
||||
// CHECK-LABEL: sil hidden @$s4test5AhmadCACyYacfc : $@convention(method) @async (@owned Ahmad) -> @owned Ahmad {
|
||||
// CHECK: bb0{{.*}}:
|
||||
// CHECK-NEXT: [[GENERIC:%[0-9]+]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK-NEXT: [[GENERIC:%[0-9]+]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC]]
|
||||
// CHECK: store {{%[0-9]+}} to {{%[0-9]+}} : $*Int
|
||||
// CHECK: } // end sil function '$s4test5AhmadCACyYacfc'
|
||||
@@ -412,7 +412,7 @@ actor Customer {
|
||||
|
||||
// CHECK-LABEL: sil hidden @$s4test8CustomerCACyYaKcfc :
|
||||
init() async throws {
|
||||
// CHECK: [[GENERIC:%[0-9]+]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
|
||||
// CHECK: [[GENERIC:%[0-9]+]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK-NEXT: hop_to_executor [[GENERIC]]
|
||||
// CHECK: [[SELF:%.*]] = end_init_let_ref %0 : $Customer
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ distributed actor NotCodableDA<ActorSystem>
|
||||
|
||||
// CHECK-LABEL: sil hidden{{.*}}@$s4test12NotCodableDAC11actorSystemACyxGx_tYacfc : $@convention(method) @async <ActorSystem where ActorSystem : DistributedActorSystem, ActorSystem.SerializationRequirement == any Decodable & Encodable> (@in ActorSystem, @sil_isolated @owned NotCodableDA<ActorSystem>) -> @owned NotCodableDA<ActorSystem> {
|
||||
init(actorSystem: ActorSystem) async {
|
||||
// CHECK: [[ISOLATION:%.*]] = enum $Optional<any Actor>, #Optional.none!enumelt
|
||||
// CHECK: hop_to_executor [[ISOLATION]]
|
||||
|
||||
self.actorSystem = actorSystem
|
||||
|
||||
// First use of #isolation, which is replaced by 'nil'.
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
// REQUIRES: swift_feature_Embedded
|
||||
|
||||
import Builtin
|
||||
import _Concurrency
|
||||
|
||||
public func test() async {
|
||||
_ = Builtin.createAsyncTask(0) { () async throws -> Int in
|
||||
|
||||
Reference in New Issue
Block a user