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
1717let deinitDevirtualizer = FunctionPass ( name: " deinit-devirtualizer " ) {
1818 ( function: Function , context: FunctionPassContext ) in
1919
20+ guard function. hasOwnership else {
21+ return
22+ }
23+
2024 for inst in function. instructions {
2125 switch inst {
2226 case let destroyValue as DestroyValueInst :
Original file line number Diff line number Diff line change @@ -283,6 +283,16 @@ bb0(%0 : $*T):
283283 return %r : $()
284284}
285285
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+
286296sil @s1_deinit : $@convention(method) (@owned S1) -> ()
287297sil @s2_deinit : $@convention(method) (@owned S2) -> ()
288298sil @s3_deinit : $@convention(method) <T> (@in S3<T>) -> ()
You can’t perform that action at this time.
0 commit comments