File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
SwiftCompilerSources/Sources/Optimizer/FunctionPasses Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ import SIL
17
17
let deinitDevirtualizer = FunctionPass ( name: " deinit-devirtualizer " ) {
18
18
( function: Function , context: FunctionPassContext ) in
19
19
20
+ guard function. hasOwnership else {
21
+ return
22
+ }
23
+
20
24
for inst in function. instructions {
21
25
switch inst {
22
26
case let destroyValue as DestroyValueInst :
Original file line number Diff line number Diff line change @@ -283,6 +283,16 @@ bb0(%0 : $*T):
283
283
return %r : $()
284
284
}
285
285
286
+ // CHECK-LABEL: sil @test_non_ossa :
287
+ // CHECK: destroy_addr %0
288
+ // CHECK: } // end sil function 'test_non_ossa'
289
+ sil @test_non_ossa : $@convention(thin) (@in S1) -> () {
290
+ bb0(%0 : $*S1):
291
+ destroy_addr %0 : $*S1
292
+ %r = tuple()
293
+ return %r : $()
294
+ }
295
+
286
296
sil @s1_deinit : $@convention(method) (@owned S1) -> ()
287
297
sil @s2_deinit : $@convention(method) (@owned S2) -> ()
288
298
sil @s3_deinit : $@convention(method) <T> (@in S3<T>) -> ()
You can’t perform that action at this time.
0 commit comments