Skip to content

Commit e408fa9

Browse files
committed
[Distributed] unlock distributed_actor_deinit test again
1 parent 90d8816 commit e408fa9

7 files changed

+170
-138
lines changed

lib/Sema/CodeSynthesisDistributedActor.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,5 @@ void swift::addImplicitDistributedActorMembersToClass(ClassDecl *decl) {
266266
return;
267267

268268
addFactoryResolveFunction(decl);
269-
// addImplicitDistributedActorStoredProperties(decl);
270269
addImplicitRemoteActorFunctions(decl);
271270
}

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6412,7 +6412,6 @@ ValueDecl *TypeChecker::deriveProtocolRequirement(DeclContext *DC,
64126412
return derived.deriveDifferentiable(Requirement);
64136413

64146414
case KnownDerivableProtocolKind::DistributedActor:
6415-
fprintf(stderr, "[%s:%d] (%s) DERIVE DistributedActor \n", __FILE__, __LINE__, __FUNCTION__);
64166415
return derived.deriveDistributedActor(Requirement);
64176416

64186417
case KnownDerivableProtocolKind::OptionSet:

test/Distributed/Runtime/distributed_actor_deinit.swift

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,33 @@
77
// UNSUPPORTED: use_os_stdlib
88
// UNSUPPORTED: back_deployment_runtime
99

10-
// REQUIRES: rdar78290608
11-
1210
import _Distributed
1311

1412
@available(SwiftStdlib 5.5, *)
15-
actor A {}
13+
actor A {}
1614

1715
@available(SwiftStdlib 5.5, *)
1816
distributed actor DA {
17+
init(transport: ActorTransport) {
18+
defer { transport.actorReady(self) }
19+
}
1920
}
2021

2122
@available(SwiftStdlib 5.5, *)
2223
distributed actor DA_userDefined {
24+
init(transport: ActorTransport) {
25+
defer { transport.actorReady(self) }
26+
}
27+
2328
deinit {}
2429
}
2530

2631
@available(SwiftStdlib 5.5, *)
2732
distributed actor DA_userDefined2 {
33+
init(transport: ActorTransport) {
34+
defer { transport.actorReady(self) }
35+
}
36+
2837
deinit {
2938
print("Deinitializing \(self.id)")
3039
return
@@ -36,6 +45,10 @@ distributed actor DA_state {
3645
var name = "Hello"
3746
var age = 42
3847

48+
init(transport: ActorTransport) {
49+
defer { transport.actorReady(self) }
50+
}
51+
3952
deinit {
4053
print("Deinitializing \(self.id)")
4154
return
@@ -59,7 +72,7 @@ struct FakeTransport: ActorTransport {
5972
fatalError("not implemented \(#function)")
6073
}
6174

62-
func resolve<Act>(_ identity: Act.ID, as actorType: Act.Type) throws -> Act?
75+
func resolve<Act>(_ identity: AnyActorIdentity, as actorType: Act.Type) throws -> Act?
6376
where Act: DistributedActor {
6477
print("resolve type:\(actorType), address:\(identity)")
6578
return nil
@@ -121,9 +134,10 @@ func test() {
121134

122135
// a remote actor should not resign it's address, it was never "assigned" it
123136
print("before")
124-
_ = try! DA_userDefined2(resolve: .init(address), using: transport)
137+
_ = try! DA_userDefined2.resolve(.init(address), using: transport)
125138
print("done")
126139
// CHECK: before
140+
// CHECK-NEXT: resolve type:DA_userDefined2, address:AnyActorIdentity(ActorAddress(address: "xxx"))
127141
// CHECK-NEXT: Deinitializing
128142
// CHECK-NEXT: done
129143
}

test/SIL/Distributed/distributed_actor_default_init_sil.swift

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,31 @@ import _Distributed
66
distributed actor SimpleEmptyDistributedActor {
77
}
88

9-
// Check the default (synthesized) constructor:
109
// CHECK: // SimpleEmptyDistributedActor.init(transport:)
11-
// sil hidden [available 12.0] @$s34distributed_actor_default_init_sil27SimpleEmptyDistributedActorC9transportAC01_H00I9Transport_p_tcfc : $@convention(method) (@in ActorTransport, @owned SimpleEmptyDistributedActor) -> @owned SimpleEmptyDistributedActor {
12-
// CHECK: [[TRANSPORT:%[0-9]+]] "transport"
13-
// CHECK: [[SELF:%[0-9]+]] "self"
14-
// CHECK: bb0([[TRANSPORT]] : $*ActorTransport, [[SELF]] : $SimpleEmptyDistributedActor):
15-
// debug_value_addr [[TRANSPORT]] : $*ActorTransport, let, name "transport", argno 1
16-
// debug_value [[SELF]] : $SimpleEmptyDistributedActor, let, name "self", argno 2
17-
// CHECK: [[DEFAULT_ACTOR_INIT:%[0-9]+]] = builtin "initializeDefaultActor"([[SELF]] : $SimpleEmptyDistributedActor) : $()
18-
// CHECK: [[OPEN_TRANSPORT_EXISTENTIAL:%[0-9]+]] = open_existential_addr immutable_access [[TRANSPORT]] : $*ActorTransport to $*@opened({{.*}}) ActorTransport
19-
// CHECK: [[SELF_METATYPE:%[0-9]+]] = metatype $@thick SimpleEmptyDistributedActor.Type
20-
// CHECK: [[ASSIGN_WITNESS_METHOD:%[0-9]+]] = witness_method $@opened({{.*}}) ActorTransport, #ActorTransport.assignIdentity : <Self where Self : ActorTransport><Act where Act : DistributedActor> (Self) -> (Act.Type) -> AnyActorIdentity, [[OPEN_TRANSPORT_EXISTENTIAL]] : $*@opened({{.*}}) ActorTransport : $@convention(witness_method: ActorTransport) <τ_0_0 where τ_0_0 : ActorTransport><τ_1_0 where τ_1_0 : DistributedActor> (@thick τ_1_0.Type, @in_guaranteed τ_0_0) -> @out AnyActorIdentity
21-
// CHECK: [[IDENTITY_STACK_TMP:%[0-9]+]] = alloc_stack $AnyActorIdentity
22-
// CHECK: [[IDENTITY_RETURNED:%[0-9]+]] = apply [[ASSIGN_WITNESS_METHOD]]<@opened({{.*}}) ActorTransport, SimpleEmptyDistributedActor>([[IDENTITY_STACK_TMP]], [[SELF_METATYPE]], [[OPEN_TRANSPORT_EXISTENTIAL]]) : $@convention(witness_method: ActorTransport) <τ_0_0 where τ_0_0 : ActorTransport><τ_1_0 where τ_1_0 : DistributedActor> (@thick τ_1_0.Type, @in_guaranteed τ_0_0) -> @out AnyActorIdentity
23-
// CHECK: [[IDENTITY_PROPERTY:%[0-9]+]] = ref_element_addr [[SELF]] : $SimpleEmptyDistributedActor, #SimpleEmptyDistributedActor.id
24-
// Store the identity
25-
// CHECK: copy_addr [take] [[IDENTITY_STACK_TMP]] to [initialization] [[IDENTITY_PROPERTY]] : $*AnyActorIdentity
26-
// CHECK: [[TRANSPORT_PROPERTY:%[0-9]+]] = ref_element_addr [[SELF]] : $SimpleEmptyDistributedActor, #SimpleEmptyDistributedActor.actorTransport
10+
// CHECK: sil hidden{{.*}} @$s34distributed_actor_default_init_sil27SimpleEmptyDistributedActorC9transportAC01_H00I9Transport_p_tcfc : $@convention(method) (@in ActorTransport, @owned SimpleEmptyDistributedActor) -> @owned SimpleEmptyDistributedActor {
11+
// CHECK: // %0 "transport" // users: %15, %7, %6, %2
12+
// CHECK: // %1 "self" // users: %5, %12, %4, %16, %3
13+
// CHECK: bb0(%0 : $*ActorTransport, %1 : $SimpleEmptyDistributedActor):
14+
// CHECK: debug_value_addr %0 : $*ActorTransport, let, name "transport", argno 1, implicit // id: %2
15+
// CHECK: debug_value %1 : $SimpleEmptyDistributedActor, let, name "self", argno 2, implicit // id: %3
16+
// CHECK: %4 = builtin "initializeDefaultActor"(%1 : $SimpleEmptyDistributedActor) : $()
17+
2718
// Store the transport
28-
// CHECK: copy_addr [[TRANSPORT]] to [initialization] [[TRANSPORT_PROPERTY]] : $*ActorTransport
29-
// CHECK: dealloc_stack [[IDENTITY_STACK_TMP]] : $*AnyActorIdentity
30-
// CHECK: destroy_addr [[TRANSPORT]] : $*ActorTransport
31-
// // While in AST the return was "return null" after SILGen we properly return the self
32-
// CHECK: return [[SELF]] : $SimpleEmptyDistributedActor
33-
// } // end sil function '$s34distributed_actor_default_init_sil27SimpleEmptyDistributedActorC9transportAC01_H00I9Transport_p_tcfc'
19+
// CHECK: %5 = ref_element_addr %1 : $SimpleEmptyDistributedActor, #SimpleEmptyDistributedActor.actorTransport // user: %6
20+
// CHECK: copy_addr %0 to [initialization] %5 : $*ActorTransport // id: %6
21+
22+
// Assign an identity
23+
// CHECK: %7 = open_existential_addr immutable_access %0 : $*ActorTransport to $*@opened("{{.*}}") ActorTransport // users: %11, %11, %9
24+
// CHECK: %8 = metatype $@thick SimpleEmptyDistributedActor.Type // user: %11
25+
// CHECK: %9 = witness_method $@opened("{{.*}}") ActorTransport, #ActorTransport.assignIdentity : <Self where Self : ActorTransport><Act where Act : DistributedActor> (Self) -> (Act.Type) -> AnyActorIdentity, %7 : $*@opened("{{.*}}") ActorTransport : $@convention(witness_method: ActorTransport) <τ_0_0 where τ_0_0 : ActorTransport><τ_1_0 where τ_1_0 : DistributedActor> (@thick τ_1_0.Type, @in_guaranteed τ_0_0) -> @out AnyActorIdentity // type-defs: %7; user: %11
26+
// CHECK: %10 = alloc_stack $AnyActorIdentity // users: %14, %13, %11
27+
// CHECK: %11 = apply %9<@opened("{{.*}}") ActorTransport, SimpleEmptyDistributedActor>(%10, %8, %7) : $@convention(witness_method: ActorTransport) <τ_0_0 where τ_0_0 : ActorTransport><τ_1_0 where τ_1_0 : DistributedActor> (@thick τ_1_0.Type, @in_guaranteed τ_0_0) -> @out AnyActorIdentity // type-defs: %7
28+
29+
// Store the identity
30+
// CHECK: %12 = ref_element_addr %1 : $SimpleEmptyDistributedActor, #SimpleEmptyDistributedActor.id // user: %13
31+
// CHECK: copy_addr [take] %10 to [initialization] %12 : $*AnyActorIdentity // id: %13
32+
33+
// CHECK: dealloc_stack %10 : $*AnyActorIdentity // id: %14
34+
// CHECK: destroy_addr %0 : $*ActorTransport // id: %15
35+
// CHECK: return %1 : $SimpleEmptyDistributedActor // id: %16
36+
// CHECK: } // end sil function '$s34distributed_actor_default_init_sil27SimpleEmptyDistributedActorC9transportAC01_H00I9Transport_p_tcfc'

test/SIL/Distributed/distributed_actor_remote_deinit_sil.swift

Lines changed: 37 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@ import _Distributed
44

55
class SomeClass {}
66

7-
@available(SwiftStdlib 5.5, *)
8-
actor SimpleActor {
9-
let someFieldInLocalActor: SomeClass
10-
init(field: SomeClass) {
11-
self.someFieldInLocalActor = field
12-
}
13-
}
14-
15-
167
@available(SwiftStdlib 5.5, *)
178
distributed actor SimpleEmptyDistributedActor {
189
let localOnlyField: SomeClass
@@ -25,73 +16,52 @@ distributed actor SimpleEmptyDistributedActor {
2516
// ==== ------------------------------------------------------------------------
2617
// ==== Check that a normal local only actor is left unchanged
2718

28-
// CHECK: // SimpleActor.deinit
29-
// CHECK: sil hidden{{.*}} @$s35distributed_actor_remote_deinit_sil11SimpleActorCfd : $@convention(method) (@guaranteed SimpleActor) -> @owned Builtin.NativeObject {
30-
// CHECK: // %0 "self" // users: %6, %5, %2, %1
31-
// CHECK: bb0(%0 : $SimpleActor):
32-
// CHECK: debug_value %0 : $SimpleActor, let, name "self", argno 1, implicit // id: %1
33-
// CHECK: %2 = ref_element_addr %0 : $SimpleActor, #SimpleActor.someFieldInLocalActor // user: %3
34-
// CHECK: %3 = load %2 : $*SomeClass // user: %4
35-
// CHECK: strong_release %3 : $SomeClass // id: %4
36-
// CHECK: %5 = builtin "destroyDefaultActor"(%0 : $SimpleActor) : $()
37-
// CHECK: %6 = unchecked_ref_cast %0 : $SimpleActor to $Builtin.NativeObject // user: %7
38-
// CHECK: return %6 : $Builtin.NativeObject // id: %7
39-
// CHECK: } // end sil function '$s35distributed_actor_remote_deinit_sil11SimpleActorCfd'
40-
41-
42-
43-
4419
// ==== deinit must have the extra "if remote..." path emitted for the
4520
// distributed actor only. That path will not attempt deallocating the
4621
// `localOnly...` fields, since they were never initialized and have no storage.
4722

4823
// CHECK: // SimpleEmptyDistributedActor.deinit
49-
// sil hidden [available 12.0] @$s35distributed_actor_remote_deinit_sil27SimpleEmptyDistributedActorCfd : $@convention(method) (@guaranteed SimpleEmptyDistributedActor) -> @owned Builtin.NativeObject {
24+
// CHECK: sil hidden{{.*}} @$s35distributed_actor_remote_deinit_sil27SimpleEmptyDistributedActorCfd : $@convention(method) (@guaranteed SimpleEmptyDistributedActor) -> @owned Builtin.NativeObject {
5025
// CHECK: // [[SELF:%[0-9]+]] "self"
5126
// CHECK: bb0(%0 : $SimpleEmptyDistributedActor):
52-
// CHECK: debug_value [[SELF]] : $SimpleEmptyDistributedActor, let, name "self", argno 1, implicit
53-
// CHECK: [[IDENTITY_ADDR:%[0-9]+]] = ref_element_addr %0 : $SimpleEmptyDistributedActor, #SimpleEmptyDistributedActor.id // users: %13, %24
54-
// CHECK: [[TRANSPORT_ADDR:%[0-9]+]] = ref_element_addr %0 : $SimpleEmptyDistributedActor, #SimpleEmptyDistributedActor.actorTransport
27+
// CHECK-NEXT: debug_value [[SELF]] : $SimpleEmptyDistributedActor, let, name "self", argno 1, implicit
28+
// CHECK-NEXT: [[IDENTITY_ADDR:%[0-9]+]] = ref_element_addr %0 : $SimpleEmptyDistributedActor, #SimpleEmptyDistributedActor.id
29+
// CHECK-NEXT: [[TRANSPORT_ADDR:%[0-9]+]] = ref_element_addr %0 : $SimpleEmptyDistributedActor, #SimpleEmptyDistributedActor.actorTransport
5530
// CHECK: [[SELF_1:%[0-9]+]] = init_existential_ref %0 : $SimpleEmptyDistributedActor : $SimpleEmptyDistributedActor, $AnyObject
5631
// CHECK: // function_ref swift_distributed_actor_is_remote
5732
// CHECK: [[IS_REMOTE_FN_1:%[0-9]+]] = function_ref @swift_distributed_actor_is_remote : $@convention(thin) (@guaranteed AnyObject) -> Bool
5833
// CHECK: [[IS_REMOTE_FN_RES_1:%[0-9]+]] = apply [[IS_REMOTE_FN_1]]([[SELF_1]]) : $@convention(thin) (@guaranteed AnyObject) -> Bool
5934
// CHECK: [[IS_REMOTE_BOOL_1:%[0-9]+]] = struct_extract [[IS_REMOTE_FN_RES_1]] : $Bool, #Bool._value
60-
// CHECK: cond_br [[IS_REMOTE_BOOL_1]], [[BB_CONT_1:bb[0-9]+]], [[BB_RESIGN_DIST_IDENTITY:bb[0-9]+]]
61-
62-
// CHECK: [[BB_CONT_1]]:
63-
// CHECK: br [[BB_CHECK_REMOTE_OR_LOCAL_MEMBER_DEINIT_TYPE:bb[0-9]+]]
64-
65-
// It was a local actor, so we resign the address:
66-
// CHECK: [[BB_RESIGN_DIST_IDENTITY]]:
67-
// %11 = open_existential_addr immutable_access %4 : $*ActorTransport to $*@opened({{.*}}) ActorTransport // users: %13, %13, %12
68-
// CHECK: [[RESIGN_FN:%[0-9]+]] = witness_method $@opened({{.*}}) ActorTransport, #ActorTransport.resignIdentity
69-
// CHECK: [[RESIGNED:%[0-9]+]] = apply [[RESIGN_FN]]<@opened({{.*}}) ActorTransport>(%3, %11) : $@convention(witness_method: ActorTransport) <τ_0_0 where τ_0_0 : ActorTransport> (@in_guaranteed AnyActorIdentity, @in_guaranteed τ_0_0) -> ()
70-
// CHECK: br [[BB_CHECK_REMOTE_OR_LOCAL_MEMBER_DEINIT_TYPE]]
71-
72-
// Check if we must skip destroying local storage because actor was remote
73-
// CHECK: [[BB_CHECK_REMOTE_OR_LOCAL_MEMBER_DEINIT_TYPE]]:
74-
// CHECK: %15 = init_existential_ref %0 : $SimpleEmptyDistributedActor : $SimpleEmptyDistributedActor, $AnyObject
75-
// CHECK: %16 = apply %6(%15) : $@convention(thin) (@guaranteed AnyObject) -> Bool
76-
// CHECK: %17 = struct_extract %16 : $Bool, #Bool._value // user: %18
77-
// CHECK: cond_br %17, [[BB_CONT_REMOTE_DONT_DESTROY_LOCAL_MEMBERS:bb[0-9]+]], [[BB_CONT_DESTROY_LOCAL_THEN_INDEPENDENT_MEMBERS:bb[0-9]+]]
78-
79-
// CHECK: [[BB_CONT_REMOTE_DONT_DESTROY_LOCAL_MEMBERS]]:
80-
// CHECK: br [[BB_DESTROY_INDEPENDENT_MEMBERS:bb[0-9]+]]
81-
82-
// We were a local instance after all, and thus must destroy local properties
83-
// CHECK: [[BB_CONT_DESTROY_LOCAL_THEN_INDEPENDENT_MEMBERS]]:
84-
// CHECK: [[FIELD_ADDR:%[0-9]+]] = ref_element_addr %0 : $SimpleEmptyDistributedActor, #SimpleEmptyDistributedActor.localOnlyField
85-
// CHECK: [[LOAD_FIELD_ADDR:%[0-9]+]] = load [[FIELD_ADDR]] : $*SomeClass
86-
// CHECK: strong_release [[LOAD_FIELD_ADDR]] : $SomeClass
87-
// CHECK: br [[BB_DESTROY_INDEPENDENT_MEMBERS]]
88-
89-
// Destroy "distributed nonisolated" fields and the actor itself
90-
// CHECK: [[BB_DESTROY_INDEPENDENT_MEMBERS]]:
91-
// CHECK: destroy_addr [[IDENTITY_ADDR]] : $*AnyActorIdentity
92-
// CHECK: destroy_addr [[TRANSPORT_ADDR]] : $*ActorTransport
93-
// CHECK: {{.*}} = builtin "destroyDefaultActor"(%0 : $SimpleEmptyDistributedActor) : $()
94-
// CHECK: dealloc_ref [[SELF]] : $SimpleEmptyDistributedActor
95-
// CHECK: [[EMPTY:%[0-9]+]] = tuple ()
96-
// CHECK: return [[EMPTY]] : $()
97-
// } // end sil function '$s35distributed_actor_remote_deinit_sil27SimpleEmptyDistributedActorCfD'
35+
// CHECK: cond_br [[IS_REMOTE_BOOL_1]], bb2, bb1
36+
37+
// CHECK: bb1: // Preds: bb0
38+
// CHECK: %9 = open_existential_addr immutable_access %3 : $*ActorTransport to $*@opened("{{.*}}") ActorTransport // users: %11, %11, %10
39+
// CHECK: %10 = witness_method $@opened("{{.*}}") ActorTransport, #ActorTransport.resignIdentity : <Self where Self : ActorTransport> (Self) -> (AnyActorIdentity) -> (), %9 : $*@opened("{{.*}}") ActorTransport : $@convention(witness_method: ActorTransport) <τ_0_0 where τ_0_0 : ActorTransport> (@in_guaranteed AnyActorIdentity, @in_guaranteed τ_0_0) -> () // type-defs: %9; user: %11
40+
// CHECK: %11 = apply %10<@opened("{{.*}}") ActorTransport>(%2, %9) : $@convention(witness_method: ActorTransport) <τ_0_0 where τ_0_0 : ActorTransport> (@in_guaranteed AnyActorIdentity, @in_guaranteed τ_0_0) -> () // type-defs: %9
41+
// CHECK: br bb3 // id: %12
42+
43+
// CHECK: bb2: // Preds: bb0
44+
// CHECK: br bb3 // id: %13
45+
46+
// CHECK: bb3: // Preds: bb1 bb2
47+
// CHECK: %14 = init_existential_ref %0 : $SimpleEmptyDistributedActor : $SimpleEmptyDistributedActor, $AnyObject // user: %15
48+
// CHECK: %15 = apply %5(%14) : $@convention(thin) (@guaranteed AnyObject) -> Bool // user: %16
49+
// CHECK: %16 = struct_extract %15 : $Bool, #Bool._value // user: %17
50+
// CHECK: cond_br %16, bb4, bb5 // id: %17
51+
52+
// CHECK: bb4: // Preds: bb3
53+
// CHECK: br bb6 // id: %18
54+
55+
// CHECK: bb5: // Preds: bb3
56+
// CHECK: %19 = ref_element_addr %0 : $SimpleEmptyDistributedActor, #SimpleEmptyDistributedActor.localOnlyField // user: %20
57+
// CHECK: %20 = load %19 : $*SomeClass // user: %21
58+
// CHECK: strong_release %20 : $SomeClass // id: %21
59+
// CHECK: br bb6 // id: %22
60+
61+
// CHECK: bb6: // Preds: bb5 bb4
62+
// CHECK: destroy_addr %3 : $*ActorTransport // id: %23
63+
// CHECK: destroy_addr %2 : $*AnyActorIdentity // id: %24
64+
// CHECK: %25 = builtin "destroyDefaultActor"(%0 : $SimpleEmptyDistributedActor) : $()
65+
// CHECK: %26 = unchecked_ref_cast %0 : $SimpleEmptyDistributedActor to $Builtin.NativeObject // user: %27
66+
// CHECK: return %26 : $Builtin.NativeObject // id: %27
67+
// CHECK: } // end sil function '$s35distributed_actor_remote_deinit_sil27SimpleEmptyDistributedActorCfd'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// RUN: %target-swift-frontend -O -primary-file %s -emit-sil -enable-experimental-distributed | %FileCheck %s --dump-input=fail
2+
3+
import _Distributed
4+
5+
class SomeClass {}
6+
7+
@available(SwiftStdlib 5.5, *)
8+
actor SimpleActor {
9+
let someFieldInLocalActor: SomeClass
10+
init(field: SomeClass) {
11+
self.someFieldInLocalActor = field
12+
}
13+
}
14+
15+
16+
// ==== ------------------------------------------------------------------------
17+
// ==== Check that a normal local only actor is left unchanged
18+
19+
// CHECK: // SimpleActor.deinit
20+
// CHECK: sil hidden{{.*}} @$s42distributed_actor_remote_deinit_sil_normal11SimpleActorCfd : $@convention(method) (@guaranteed SimpleActor) -> @owned Builtin.NativeObject {
21+
// CHECK: // %0 "self" // users: %6, %5, %2, %1
22+
// CHECK: bb0(%0 : $SimpleActor):
23+
// CHECK: debug_value %0 : $SimpleActor, let, name "self", argno 1, implicit
24+
// CHECK: %2 = ref_element_addr %0 : $SimpleActor, #SimpleActor.someFieldInLocalActor
25+
// CHECK: %3 = load %2 : $*SomeClass // user: %4
26+
// CHECK: strong_release %3 : $SomeClass // id: %4
27+
// CHECK: %5 = builtin "destroyDefaultActor"(%0 : $SimpleActor) : $()
28+
// CHECK: %6 = unchecked_ref_cast %0 : $SimpleActor to $Builtin.NativeObject // user: %7
29+
// CHECK: return %6 : $Builtin.NativeObject // id: %7
30+
// CHECK: } // end sil function '$s42distributed_actor_remote_deinit_sil_normal11SimpleActorCfd'
31+

0 commit comments

Comments
 (0)