1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
|
// First parse this and then emit a *.sib. Then read in the *.sib, then recreate
// RUN: %empty-directory(%t)
// RUN: %target-sil-opt %s -emit-sib -o %t/tmp.sib -module-name keypaths
// RUN: %target-sil-opt %t/tmp.sib -emit-sib -o %t/tmp.2.sib -module-name keypaths
// RUN: %target-sil-opt %t/tmp.2.sib -module-name keypaths -emit-sorted-sil | %FileCheck %s
// Keep this file in sorted order by using alphabetical prefixes on the SIL functions.
sil_stage canonical
import Swift
public struct S: Hashable {
public var x: Int
public let y: String
public var z: C
public func hash(into hasher: inout Hasher)
public static func ==(x: S, y: S) -> Bool
}
public class C: Hashable {
public final var x: Int
public final let y: String
public final var z: S
public init()
public var overridable: Int {
get set
}
public func hash(into hasher: inout Hasher)
public static func ==(x: C, y: C) -> Bool
}
protocol P {}
protocol Q {}
protocol R {}
public struct Gen<A: P, B: Q, C: R> {
public var x: A
public let y: B
public var z: C
}
public struct External<T> {
public var ro: T
subscript<U: Hashable>(ro _: U) -> T { get }
init()
}
public struct T {
public var x: (Int, Int)
public var y: (a: Int, b: Int, c: Int)
public let z: (Int, Int)
public let w: (Int, C)
}
public struct GenT<A, B> {
public var x: (A, B)
public let y: (a: A, b: B)
public let z: (e0: External<A>, e1: External<B>)
}
// CHECK-LABEL: sil shared [serialized] @AA_stored_properties
sil shared [serialized] @AA_stored_properties : $@convention(thin) () -> () {
entry:
// CHECK: keypath $WritableKeyPath<S, Int>, (root $S; stored_property #S.x : $Int)
%a = keypath $WritableKeyPath<S, Int>, (root $S; stored_property #S.x : $Int)
// CHECK: keypath $ReferenceWritableKeyPath<C, Int>, (root $C; stored_property #C.x : $Int)
%b = keypath $ReferenceWritableKeyPath<C, Int>, (root $C; stored_property #C.x : $Int)
// CHECK: keypath $KeyPath<S, String>, (root $S; stored_property #S.y : $String)
%c = keypath $KeyPath<S, String>, (root $S; stored_property #S.y : $String)
// CHECK: keypath $ReferenceWritableKeyPath<S, Int>, (root $S; stored_property #S.z : $C; stored_property #C.x : $Int)
%d = keypath $ReferenceWritableKeyPath<S, Int>, (root $S; stored_property #S.z : $C; stored_property #C.x : $Int)
return undef : $()
}
// CHECK-LABEL: sil shared [serialized] @BB_stored_properties_generic
sil shared [serialized] @BB_stored_properties_generic : $@convention(thin) <D: P, E: Q, F: R> () -> () {
entry:
// CHECK: keypath $WritableKeyPath<Gen<D, E, F>, D>, <τ_0_0, τ_0_1, τ_0_2 where {{.*}}> (root $Gen<τ_0_0, τ_0_1, τ_0_2>; stored_property #Gen.x : $τ_0_0) <D, E, F>
%a = keypath $WritableKeyPath<Gen<D,E,F>, D>, <G: P, H: Q, I: R> (root $Gen<G, H, I>; stored_property #Gen.x : $G) <D, E, F>
// CHECK: keypath $KeyPath<Gen<D, E, F>, E>, <τ_0_0, τ_0_1, τ_0_2 where {{.*}}> (root $Gen<τ_0_0, τ_0_1, τ_0_2>; stored_property #Gen.y : $τ_0_1) <D, E, F>
%b = keypath $KeyPath<Gen<D,E,F>, E>, <G: P, H: Q, I: R> (root $Gen<G, H, I>; stored_property #Gen.y : $H) <D, E, F>
return undef : $()
}
// CHECK-LABEL: sil shared [serialized] @CC_tuple_elements
sil shared [serialized] @CC_tuple_elements : $@convention(thin) () -> () {
entry:
// CHECK: keypath $WritableKeyPath<T, Int>, (root $T; stored_property #T.x : $(Int, Int); tuple_element #0 : $Int)
%a = keypath $WritableKeyPath<T, Int>, (root $T; stored_property #T.x : $(Int, Int); tuple_element #0 : $Int)
// CHECK: keypath $WritableKeyPath<T, Int>, (root $T; stored_property #T.y : $(a: Int, b: Int, c: Int); tuple_element #2 : $Int)
%b = keypath $WritableKeyPath<T, Int>, (root $T; stored_property #T.y : $(a: Int, b: Int, c: Int); tuple_element #2 : $Int)
// CHECK: keypath $KeyPath<T, Int>, (root $T; stored_property #T.z : $(Int, Int); tuple_element #1 : $Int)
%c = keypath $KeyPath<T, Int>, (root $T; stored_property #T.z : $(Int, Int); tuple_element #1 : $Int)
// CHECK: keypath $ReferenceWritableKeyPath<T, C>, (root $T; stored_property #T.w : $(Int, C); tuple_element #1 : $C)
%d = keypath $ReferenceWritableKeyPath<T, C>, (root $T; stored_property #T.w : $(Int, C); tuple_element #1 : $C)
return undef : $()
}
// CHECK-LABEL: sil shared [serialized] @DD_tuple_generic
sil shared [serialized] @DD_tuple_generic : $@convention(thin) <T, U> () -> () {
entry:
// CHECK: keypath $WritableKeyPath<(T, U), T>, <τ_0_0, τ_0_1> (root $(τ_0_0, τ_0_1); tuple_element #0 : $τ_0_0) <T, U>
%a = keypath $WritableKeyPath<(T, U), T>, <τ_0_0, τ_0_1> (root $(τ_0_0, τ_0_1); tuple_element #0 : $τ_0_0) <T, U>
// CHECK: keypath $WritableKeyPath<(T, U), U>, <τ_0_0, τ_0_1> (root $(τ_0_0, τ_0_1); tuple_element #1 : $τ_0_1) <T, U>
%b = keypath $WritableKeyPath<(T, U), U>, <τ_0_0, τ_0_1> (root $(τ_0_0, τ_0_1); tuple_element #1 : $τ_0_1) <T, U>
// CHECK: keypath $WritableKeyPath<GenT<T, U>, T>, <τ_0_0, τ_0_1> (root $GenT<τ_0_0, τ_0_1>; stored_property #GenT.x : $(τ_0_0, τ_0_1); tuple_element #0 : $τ_0_0) <T, U>
%c = keypath $WritableKeyPath<GenT<T, U>, T>, <τ_0_0, τ_0_1> (root $GenT<τ_0_0, τ_0_1>; stored_property #GenT.x : $(τ_0_0, τ_0_1); tuple_element #0 : $τ_0_0) <T, U>
// CHECK: keypath $WritableKeyPath<GenT<T, U>, U>, <τ_0_0, τ_0_1> (root $GenT<τ_0_0, τ_0_1>; stored_property #GenT.x : $(τ_0_0, τ_0_1); tuple_element #1 : $τ_0_1) <T, U>
%d = keypath $WritableKeyPath<GenT<T, U>, U>, <τ_0_0, τ_0_1> (root $GenT<τ_0_0, τ_0_1>; stored_property #GenT.x : $(τ_0_0, τ_0_1); tuple_element #1 : $τ_0_1) <T, U>
// CHECK: keypath $KeyPath<GenT<T, U>, T>, <τ_0_0, τ_0_1> (root $GenT<τ_0_0, τ_0_1>; stored_property #GenT.y : $(a: τ_0_0, b: τ_0_1); tuple_element #0 : $τ_0_0) <T, U>
%e = keypath $KeyPath<GenT<T, U>, T>, <τ_0_0, τ_0_1> (root $GenT<τ_0_0, τ_0_1>; stored_property #GenT.y : $(a: τ_0_0, b: τ_0_1); tuple_element #0 : $τ_0_0) <T, U>
// CHECK: keypath $KeyPath<GenT<T, U>, U>, <τ_0_0, τ_0_1> (root $GenT<τ_0_0, τ_0_1>; stored_property #GenT.y : $(a: τ_0_0, b: τ_0_1); tuple_element #1 : $τ_0_1) <T, U>
%f = keypath $KeyPath<GenT<T, U>, U>, <τ_0_0, τ_0_1> (root $GenT<τ_0_0, τ_0_1>; stored_property #GenT.y : $(a: τ_0_0, b: τ_0_1); tuple_element #1 : $τ_0_1) <T, U>
// CHECK: keypath $KeyPath<GenT<T, U>, T>, <τ_0_0, τ_0_1> (root $GenT<τ_0_0, τ_0_1>; stored_property #GenT.z : $(e0: External<τ_0_0>, e1: External<τ_0_1>); tuple_element #0 : $External<τ_0_0>; stored_property #External.ro : $τ_0_0) <T, U>
%g = keypath $KeyPath<GenT<T, U>, T>, <τ_0_0, τ_0_1> (root $GenT<τ_0_0, τ_0_1>; stored_property #GenT.z : $(e0: External<τ_0_0>, e1: External<τ_0_1>); tuple_element #0 : $External<τ_0_0>; stored_property #External.ro : $τ_0_0) <T, U>
// CHECK: keypath $KeyPath<GenT<T, U>, U>, <τ_0_0, τ_0_1> (root $GenT<τ_0_0, τ_0_1>; stored_property #GenT.z : $(e0: External<τ_0_0>, e1: External<τ_0_1>); tuple_element #1 : $External<τ_0_1>; stored_property #External.ro : $τ_0_1) <T, U>
%h = keypath $KeyPath<GenT<T, U>, U>, <τ_0_0, τ_0_1> (root $GenT<τ_0_0, τ_0_1>; stored_property #GenT.z : $(e0: External<τ_0_0>, e1: External<τ_0_1>); tuple_element #1 : $External<τ_0_1>; stored_property #External.ro : $τ_0_1) <T, U>
return undef : $()
}
sil @id_a : $@convention(thin) () -> ()
sil @get_s_int : $@convention(keypath_accessor_getter) (@in_guaranteed S) -> @out Int
sil @set_s_int : $@convention(keypath_accessor_setter) (@in_guaranteed Int, @in_guaranteed S) -> ()
sil @get_c_int : $@convention(keypath_accessor_getter) (@in_guaranteed C) -> @out Int
sil @set_c_int : $@convention(keypath_accessor_setter) (@in_guaranteed Int, @in_guaranteed C) -> ()
sil @get_fns_fnc : $@convention(keypath_accessor_getter) (@in_guaranteed @callee_guaranteed @substituted <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0) -> @out τ_0_1 for <S, S>) -> @out @callee_guaranteed @substituted <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0) -> @out τ_0_1 for <C, C>
sil @set_fns_fnc : $@convention(keypath_accessor_setter) (@in_guaranteed @callee_guaranteed @substituted <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0) -> @out τ_0_1 for <C, C>, @in_guaranteed @callee_guaranteed @substituted <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0) -> @out τ_0_1 for <S, S>) -> ()
sil @get_s_int_subs : $@convention(keypath_accessor_getter) (@in_guaranteed S, @in_guaranteed (S, C)) -> @out Int
sil @set_s_int_subs : $@convention(keypath_accessor_setter) (@in_guaranteed Int, @in_guaranteed S, @in_guaranteed (S, C)) -> ()
sil @subs_eq : $@convention(keypath_accessor_equals) (@in_guaranteed (S, C), @in_guaranteed (S, C)) -> Bool
sil @subs_hash : $@convention(keypath_accessor_hash) (@in_guaranteed (S, C)) -> Int
sil @get_gen_int_subs : $@convention(keypath_accessor_getter) <A: Hashable, B: Hashable, C: Hashable> (@in_guaranteed A, @in_guaranteed (S, C)) -> @out C
sil @set_gen_int_subs : $@convention(keypath_accessor_setter) <A: Hashable, B: Hashable, C: Hashable> (@in_guaranteed C, @in_guaranteed A, @in_guaranteed (S, C)) -> ()
sil @gen_subs_eq : $@convention(keypath_accessor_equals) <A: Hashable, B: Hashable, C: Hashable> (@in_guaranteed (S, C), @in_guaranteed (S, C)) -> Bool
sil @gen_subs_hash : $@convention(keypath_accessor_hash) <A: Hashable, B: Hashable, C: Hashable> (@in_guaranteed (S, C)) -> Int
// CHECK-LABEL: sil shared [serialized] @EE_computed_properties
sil shared [serialized] @EE_computed_properties : $@convention(thin) () -> () {
entry:
// CHECK: keypath $KeyPath<S, Int>, (root $S; gettable_property $Int, id @id_a : $@convention(thin) () -> (), getter @get_s_int : $@convention(keypath_accessor_getter) (@in_guaranteed S) -> @out Int)
%a = keypath $KeyPath<S, Int>, (root $S; gettable_property $Int, id @id_a : $@convention(thin) () -> (), getter @get_s_int : $@convention(keypath_accessor_getter) (@in_guaranteed S) -> @out Int)
// CHECK: keypath $WritableKeyPath<S, Int>, (root $S; settable_property $Int, id @id_a : $@convention(thin) () -> (), getter @get_s_int : $@convention(keypath_accessor_getter) (@in_guaranteed S) -> @out Int, setter @set_s_int : $@convention(keypath_accessor_setter) (@in_guaranteed Int, @in_guaranteed S) -> ())
%b = keypath $WritableKeyPath<S, Int>, (root $S; settable_property $Int, id @id_a : $@convention(thin) () -> (), getter @get_s_int : $@convention(keypath_accessor_getter) (@in_guaranteed S) -> @out Int, setter @set_s_int : $@convention(keypath_accessor_setter) (@in_guaranteed Int, @in_guaranteed S) -> ())
// CHECK: keypath $WritableKeyPath<(S) -> S, (C) -> C>, (root $(S) -> S; settable_property $(C) -> C, id @id_a : $@convention(thin) () -> (), getter @get_fns_fnc : $@convention(keypath_accessor_getter) (@in_guaranteed @callee_guaranteed @substituted <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0) -> @out τ_0_1 for <S, S>) -> @out @callee_guaranteed @substituted <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0) -> @out τ_0_1 for <C, C>, setter @set_fns_fnc : $@convention(keypath_accessor_setter) (@in_guaranteed @callee_guaranteed @substituted <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0) -> @out τ_0_1 for <C, C>, @in_guaranteed @callee_guaranteed @substituted <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0) -> @out τ_0_1 for <S, S>) -> ())
%c = keypath $WritableKeyPath<(S) -> S, (C) -> C>, (root $(S) -> S; settable_property $(C) -> C, id @id_a : $@convention(thin) () -> (), getter @get_fns_fnc : $@convention(keypath_accessor_getter) (@in_guaranteed @callee_guaranteed @substituted <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0) -> @out τ_0_1 for <S, S>) -> @out @callee_guaranteed @substituted <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0) -> @out τ_0_1 for <C, C>, setter @set_fns_fnc : $@convention(keypath_accessor_setter) (@in_guaranteed @callee_guaranteed @substituted <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0) -> @out τ_0_1 for <C, C>, @in_guaranteed @callee_guaranteed @substituted <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0) -> @out τ_0_1 for <S, S>) -> ())
// CHECK: keypath $WritableKeyPath<C, Int>, (root $C; settable_property $Int, id #C.overridable!getter : (C) -> () -> Int, getter @get_c_int : $@convention(keypath_accessor_getter) (@in_guaranteed C) -> @out Int, setter @set_c_int : $@convention(keypath_accessor_setter) (@in_guaranteed Int, @in_guaranteed C) -> ())
%d = keypath $WritableKeyPath<C, Int>, (root $C; settable_property $Int, id #C.overridable!getter : (C) -> () -> Int, getter @get_c_int : $@convention(keypath_accessor_getter) (@in_guaranteed C) -> @out Int, setter @set_c_int : $@convention(keypath_accessor_setter) (@in_guaranteed Int, @in_guaranteed C) -> ())
return undef : $()
}
sil @get_gen_a : $@convention(keypath_accessor_getter) <X1: P, Y1: Q, Z1: R> (@in_guaranteed Gen<X1, Y1, Z1>) -> @out X1
sil @set_gen_a : $@convention(keypath_accessor_setter) <X2: P, Y2: Q, Z2: R> (@in_guaranteed X2, @in_guaranteed Gen<X2, Y2, Z2>) -> ()
// CHECK-LABEL: sil shared [serialized] @FF_computed_properties_generic
sil shared [serialized] @FF_computed_properties_generic : $@convention(thin) <D: P, E: Q, F: R> () -> () {
entry:
// CHECK: keypath $KeyPath<Gen<D, E, F>, D>, <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : P, τ_0_1 : Q, τ_0_2 : R> (root $Gen<τ_0_0, τ_0_1, τ_0_2>; settable_property $τ_0_0, id @id_a : $@convention(thin) () -> (), getter @get_gen_a : $@convention(keypath_accessor_getter) <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : P, τ_0_1 : Q, τ_0_2 : R> (@in_guaranteed Gen<τ_0_0, τ_0_1, τ_0_2>) -> @out τ_0_0, setter @set_gen_a : $@convention(keypath_accessor_setter) <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : P, τ_0_1 : Q, τ_0_2 : R> (@in_guaranteed τ_0_0, @in_guaranteed Gen<τ_0_0, τ_0_1, τ_0_2>) -> ()) <D, E, F>
%a = keypath $KeyPath<Gen<D, E, F>, D>, <G: P, H: Q, I: R> (root $Gen<G, H, I>; settable_property $G, id @id_a : $@convention(thin) () -> (), getter @get_gen_a : $@convention(keypath_accessor_getter) <X3: P, Y3: Q, Z3: R> (@in_guaranteed Gen<X3, Y3, Z3>) -> @out X3, setter @set_gen_a : $@convention(keypath_accessor_setter) <X4: P, Y4: Q, Z4: R> (@in_guaranteed X4, @in_guaranteed Gen<X4, Y4, Z4>) -> ()) <D, E, F>
return undef : $()
}
// CHECK-LABEL: sil shared [serialized] @GG_optional
sil shared [serialized] @GG_optional : $@convention(thin) () -> () {
entry:
// CHECK: keypath $KeyPath<Optional<Int>, Optional<Int>>, (root $Optional<Int>; optional_chain : $Int; optional_wrap : $Optional<Int>)
%a = keypath $KeyPath<Optional<Int>, Optional<Int>>, (root $Optional<Int>; optional_chain : $Int; optional_wrap : $Optional<Int>)
// CHECK: keypath $KeyPath<Optional<Int>, Int>, (root $Optional<Int>; optional_force : $Int)
%b = keypath $KeyPath<Optional<Int>, Int>, (root $Optional<Int>; optional_force : $Int)
return undef : $()
}
// CHECK-LABEL: sil shared [serialized] @HH_indexes
sil shared [serialized] @HH_indexes : $@convention(thin) (S, C) -> () {
// CHECK: bb0([[S:%.*]] : $S, [[C:%.*]] : $C):
entry(%s : $S, %c : $C):
// CHECK: keypath $KeyPath<S, Int>, (root $S; settable_property $Int, id @id_a : $@convention(thin) () -> (), getter @get_s_int_subs : $@convention(keypath_accessor_getter) (@in_guaranteed S, @in_guaranteed (S, C)) -> @out Int, setter @set_s_int_subs : $@convention(keypath_accessor_setter) (@in_guaranteed Int, @in_guaranteed S, @in_guaranteed (S, C)) -> (), indices [%$0 : $S : $S, %$1 : $C : $C], indices_equals @subs_eq : $@convention(keypath_accessor_equals) (@in_guaranteed (S, C), @in_guaranteed (S, C)) -> Bool, indices_hash @subs_hash : $@convention(keypath_accessor_hash) (@in_guaranteed (S, C)) -> Int) ([[S]], [[C]])
%a = keypath $KeyPath<S, Int>, (root $S; settable_property $Int, id @id_a : $@convention(thin) () -> (), getter @get_s_int_subs : $@convention(keypath_accessor_getter) (@in_guaranteed S, @in_guaranteed (S, C)) -> @out Int, setter @set_s_int_subs : $@convention(keypath_accessor_setter) (@in_guaranteed Int, @in_guaranteed S, @in_guaranteed (S, C)) -> (), indices [%$0 : $S : $S, %$1 : $C : $C], indices_equals @subs_eq : $@convention(keypath_accessor_equals) (@in_guaranteed (S, C), @in_guaranteed (S, C)) -> Bool, indices_hash @subs_hash : $@convention(keypath_accessor_hash) (@in_guaranteed (S, C)) -> Int) (%s, %c)
// CHECK: [[T:%.*]] = alloc_stack
%t = alloc_stack $S
// CHECK: [[D:%.*]] = alloc_stack
%d = alloc_stack $C
// CHECK: keypath $KeyPath<S, Int>, <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : Hashable, τ_0_1 : Hashable, τ_0_2 : Hashable> (root $τ_0_0; settable_property $τ_0_2, id @id_a : $@convention(thin) () -> (), getter @get_gen_int_subs : $@convention(keypath_accessor_getter) <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : Hashable, τ_0_1 : Hashable, τ_0_2 : Hashable> (@in_guaranteed τ_0_0, @in_guaranteed (S, τ_0_2)) -> @out τ_0_2, setter @set_gen_int_subs : $@convention(keypath_accessor_setter) <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : Hashable, τ_0_1 : Hashable, τ_0_2 : Hashable> (@in_guaranteed τ_0_2, @in_guaranteed τ_0_0, @in_guaranteed (S, τ_0_2)) -> (), indices [%$0 : $τ_0_0 : $*τ_0_0, %$1 : $τ_0_1 : $*τ_0_1], indices_equals @gen_subs_eq : $@convention(keypath_accessor_equals) <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : Hashable, τ_0_1 : Hashable, τ_0_2 : Hashable> (@in_guaranteed (S, τ_0_2), @in_guaranteed (S, τ_0_2)) -> Bool, indices_hash @gen_subs_hash : $@convention(keypath_accessor_hash) <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : Hashable, τ_0_1 : Hashable, τ_0_2 : Hashable> (@in_guaranteed (S, τ_0_2)) -> Int) <S, C, Int> ([[T]], [[D]])
%b = keypath $KeyPath<S, Int>, <τ_0_0: Hashable, Y: Hashable, Z: Hashable> (root $τ_0_0; settable_property $Z, id @id_a : $@convention(thin) () -> (), getter @get_gen_int_subs : $@convention(keypath_accessor_getter) <A: Hashable, B: Hashable, C: Hashable> (@in_guaranteed A, @in_guaranteed (S, C)) -> @out C, setter @set_gen_int_subs : $@convention(keypath_accessor_setter) <A: Hashable, B: Hashable, C: Hashable> (@in_guaranteed C, @in_guaranteed A, @in_guaranteed (S, C)) -> (), indices [%$0 : $τ_0_0 : $*τ_0_0, %$1 : $Y : $*Y], indices_equals @gen_subs_eq : $@convention(keypath_accessor_equals) <A: Hashable, B: Hashable, C: Hashable> (@in_guaranteed (S, C), @in_guaranteed (S, C)) -> Bool, indices_hash @gen_subs_hash : $@convention(keypath_accessor_hash) <A: Hashable, B: Hashable, C: Hashable> (@in_guaranteed (S, C)) -> Int) <S, C, Int> (%t, %d)
dealloc_stack %d : $*C
dealloc_stack %t : $*S
return undef : $()
}
// CHECK-LABEL: sil shared [serialized] @II_external
sil shared [serialized] @II_external : $@convention(thin) <D: P, E: Q, F: R> () -> () {
entry:
// CHECK: keypath $KeyPath<Gen<D, E, F>, D>, <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : P, τ_0_1 : Q, τ_0_2 : R> (root $Gen<τ_0_0, τ_0_1, τ_0_2>; settable_property $τ_0_0, id @id_a : $@convention(thin) () -> (), getter @get_gen_a : $@convention(keypath_accessor_getter) <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : P, τ_0_1 : Q, τ_0_2 : R> (@in_guaranteed Gen<τ_0_0, τ_0_1, τ_0_2>) -> @out τ_0_0, setter @set_gen_a : $@convention(keypath_accessor_setter) <τ_0_0, τ_0_1, τ_0_2 where τ_0_0 : P, τ_0_1 : Q, τ_0_2 : R> (@in_guaranteed τ_0_0, @in_guaranteed Gen<τ_0_0, τ_0_1, τ_0_2>) -> (), external #Gen.x<τ_0_0, τ_0_1, τ_0_2>) <D, E, F>
%a = keypath $KeyPath<Gen<D, E, F>, D>, <G: P, H: Q, I: R> (root $Gen<G, H, I>; settable_property $G, id @id_a : $@convention(thin) () -> (), getter @get_gen_a : $@convention(keypath_accessor_getter) <X3: P, Y3: Q, Z3: R> (@in_guaranteed Gen<X3, Y3, Z3>) -> @out X3, setter @set_gen_a : $@convention(keypath_accessor_setter) <X4: P, Y4: Q, Z4: R> (@in_guaranteed X4, @in_guaranteed Gen<X4, Y4, Z4>) -> (), external #Gen.x<G, H, I>) <D, E, F>
return undef : $()
}
sil [serialized] @serialize_all : $@convention(thin) () -> () {
entry:
%0 = function_ref @AA_stored_properties : $@convention(thin) () -> ()
%1 = function_ref @BB_stored_properties_generic : $@convention(thin) <D: P, E: Q, F: R> () -> ()
%2 = function_ref @CC_tuple_elements : $@convention(thin) () -> ()
%3 = function_ref @DD_tuple_generic : $@convention(thin) <T, U> () -> ()
%4 = function_ref @EE_computed_properties : $@convention(thin) () -> ()
%5 = function_ref @FF_computed_properties_generic : $@convention(thin) <D: P, E: Q, F: R> () -> ()
%6 = function_ref @GG_optional : $@convention(thin) () -> ()
%7 = function_ref @HH_indexes : $@convention(thin) (S, C) -> ()
%8 = function_ref @II_external : $@convention(thin) <D: P, E: Q, F: R> () -> ()
unreachable
}
sil [serialized] @get_external_subscript : $@convention(keypath_accessor_getter) <T, U: Hashable> (@in_guaranteed External<T>, @in_guaranteed U) -> @out T
sil [serialized] @equals_external_subscript : $@convention(keypath_accessor_equals) <U: Hashable, T> (@in_guaranteed U, @in_guaranteed U) -> Bool
sil [serialized] @hash_external_subscript : $@convention(keypath_accessor_hash) <U: Hashable, T> (@in_guaranteed U) -> Int
// CHECK-LABEL: sil_property [serialized] #External.ro<τ_0_0> (stored_property #External.ro : $τ_0_0)
sil_property [serialized] #External.ro <T> (stored_property #External.ro : $T)
// CHECK-LABEL: sil_property [serialized] #External.subscript<τ_0_0><τ_1_0 where τ_1_0 : Hashable> (gettable_property $τ_0_0,
// CHECK-SAME: id @id_a : $@convention(thin) () -> (),
// CHECK-SAME: getter @get_external_subscript : $@convention(keypath_accessor_getter) <τ_0_0, τ_0_1 where τ_0_1 : Hashable> (@in_guaranteed External<τ_0_0>, @in_guaranteed τ_0_1) -> @out τ_0_0)
sil_property [serialized] #External.subscript <T><U: Hashable> (gettable_property $T,
id @id_a : $@convention(thin) () -> (),
getter @get_external_subscript : $@convention(keypath_accessor_getter) <T, U: Hashable> (@in_guaranteed External<T>, @in_guaranteed U) -> @out T)
|