mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Codegen is the same, but `begin_dealloc_ref` consumes the operand and produces a new SSA value. This cleanly splits the liferange to the region before and within the destructor of a class.
30 lines
740 B
Plaintext
30 lines
740 B
Plaintext
// RUN: %target-sil-opt -enable-sil-verify-all %s -object-outliner | %FileCheck %s
|
|
|
|
// REQUIRES: swift_in_compiler
|
|
|
|
|
|
import Builtin
|
|
import Swift
|
|
class B { }
|
|
class E : B { }
|
|
|
|
// CHECK: sil @patatino : $@convention(thin) () -> () {
|
|
// CHECK: bb0:
|
|
// CHECK-NEXT: integer_literal
|
|
// CHECK-NEXT: global_value @patatinoTv_ : $B
|
|
// CHECK-NEXT: strong_retain
|
|
// CHECK-NEXT: strong_release
|
|
// CHECK-NEXT: tuple ()
|
|
// CHECK-NEXT: return
|
|
// CHECK-NEXT: }
|
|
|
|
sil @patatino : $@convention(thin) () -> () {
|
|
%0 = integer_literal $Builtin.Word, 0
|
|
%1 = alloc_ref [tail_elems $Int64 * %0 : $Builtin.Word] $B
|
|
%2 = end_cow_mutation %1 : $B
|
|
%3 = begin_dealloc_ref %2 : $B of %1 : $B
|
|
dealloc_ref %3 : $B
|
|
%45 = tuple ()
|
|
return %45 : $()
|
|
}
|