@@ -318,34 +318,49 @@ sil @stored_property_fixed_offsets : $@convention(thin) () -> () {
318
318
entry:
319
319
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_A]], ptr undef)
320
320
%a = keypath $KeyPath<S, Int>, (root $S; stored_property #S.x : $Int)
321
+ strong_retain %a : $KeyPath<S, Int>
321
322
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_B]], ptr undef)
322
323
%b = keypath $KeyPath<S, String>, (root $S; stored_property #S.y : $String)
324
+ strong_retain %b : $KeyPath<S, String>
323
325
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_C]], ptr undef)
324
326
%c = keypath $KeyPath<S, C>, (root $S; stored_property #S.z : $C)
327
+ strong_retain %c : $KeyPath<S, C>
325
328
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_D]], ptr undef)
326
329
%d = keypath $KeyPath<C, Int>, (root $C; stored_property #C.x : $Int)
330
+ strong_retain %d : $KeyPath<C, Int>
327
331
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_D1]], ptr undef)
328
332
%d1 = keypath $KeyPath<C1, Int>, (root $C1; stored_property #C.x : $Int)
333
+ strong_retain %d1 : $KeyPath<C1, Int>
329
334
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_E]], ptr undef)
330
335
%e = keypath $KeyPath<C, String>, (root $C; stored_property #C.y : $String)
336
+ strong_retain %e : $KeyPath<C, String>
331
337
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_F]], ptr undef)
332
338
%f = keypath $KeyPath<C, S>, (root $C; stored_property #C.z : $S)
339
+ strong_retain %f : $KeyPath<C, S>
333
340
334
341
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_G]], ptr undef)
335
342
%g = keypath $KeyPath<S, Int>, (root $S; stored_property #S.z : $C; stored_property #C.x : $Int)
343
+ strong_retain %g : $KeyPath<S, Int>
336
344
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_H]], ptr undef)
337
345
%h = keypath $KeyPath<C, Int>, (root $C; stored_property #C.z : $S; stored_property #S.x : $Int)
346
+ strong_retain %h : $KeyPath<C, Int>
338
347
339
348
%k = keypath $KeyPath<S, Int>, (root $S; gettable_property $Int, id @k_id : $@convention(thin) () -> (), getter @k_get : $@convention(keypath_accessor_getter) (@in_guaranteed S) -> @out Int)
349
+ strong_retain %k : $KeyPath<S, Int>
340
350
%l = keypath $KeyPath<C, Int>, (root $C; settable_property $Int, id #C.w!getter, getter @l_get : $@convention(keypath_accessor_getter) (@in_guaranteed C) -> @out Int, setter @l_set : $@convention(keypath_accessor_setter) (@in_guaranteed Int, @in_guaranteed C) -> ())
351
+ strong_retain %l : $KeyPath<C, Int>
341
352
%m = keypath $KeyPath<S, () -> ()>, (root $S; settable_property $() -> (), id ##S.reabstracted, getter @m_get : $@convention(keypath_accessor_getter) (@in_guaranteed S) -> @out @callee_guaranteed @substituted <A> () -> @out A for <()>, setter @m_set : $@convention(keypath_accessor_setter) (@in_guaranteed @callee_guaranteed @substituted <A> () -> @out A for <()>, @inout S) -> ())
353
+ strong_retain %m : $KeyPath<S, () -> ()>
342
354
%m2 = keypath $KeyPath<C2, () -> ()>, (root $C2; settable_property $() -> (), id ##C2.reabstracted, getter @m2_get : $@convention(keypath_accessor_getter) (@in_guaranteed C2) -> @out @callee_guaranteed @substituted <A> () -> @out A for <()>, setter @m2_set : $@convention(keypath_accessor_setter) (@in_guaranteed @callee_guaranteed @substituted <A> () -> @out A for <()>, @inout C2) -> ())
355
+ strong_retain %m2 : $KeyPath<C2, () -> ()>
343
356
344
357
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_T0]], ptr undef)
345
358
%t0 = keypath $KeyPath<T, Int>, (root $T; stored_property #T.a : $(Int, String); tuple_element #0 : $Int)
359
+ strong_retain %t0 : $KeyPath<T, Int>
346
360
347
361
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_T1]], ptr undef)
348
362
%t1 = keypath $KeyPath<T, Int>, (root $T; stored_property #T.b : $(f: String, g: Int); tuple_element #1 : $Int)
363
+ strong_retain %t1 : $KeyPath<T, Int>
349
364
350
365
return undef : $()
351
366
}
@@ -395,18 +410,21 @@ entry:
395
410
// CHECK: store ptr %T, ptr [[ARGS]]
396
411
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_I]], ptr [[ARGS]])
397
412
%i = keypath $KeyPath<Gen<T,T>, T>, <A> (root $Gen<A, A>; stored_property #Gen.x : $A) <T>
413
+ strong_retain %i : $KeyPath<Gen<T,T>, T>
398
414
399
415
// CHECK: [[ARGS:%.*]] = alloca i{{.*}}
400
416
// CHECK: store ptr %U, ptr [[ARGS]]
401
417
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_J]], ptr [[ARGS]])
402
418
%j = keypath $KeyPath<Gen<U,U>, U>, <A> (root $Gen<A, A>; stored_property #Gen.y : $A) <U>
419
+ strong_retain %j : $KeyPath<Gen<U,U>, U>
403
420
404
421
// CHECK: [[ARGS:%.*]] = alloca i{{.*}}
405
422
// CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s8keypaths3FooVMa"([[WORD]] 0, ptr %T)
406
423
// CHECK: [[FOO_T:%.*]] = extractvalue %swift.metadata_response [[T0]], 0
407
424
// CHECK: store ptr [[FOO_T]], ptr [[ARGS]]
408
425
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_I]], ptr [[ARGS]])
409
426
%i2 = keypath $KeyPath<Gen<Foo<T>,Foo<T>>, Foo<T>>, <A> (root $Gen<A, A>; stored_property #Gen.x : $A) <Foo<T>>
427
+ strong_retain %i2 : $KeyPath<Gen<Foo<T>,Foo<T>>, Foo<T>>
410
428
411
429
return undef : $()
412
430
}
@@ -418,23 +436,27 @@ entry:
418
436
// CHECK: store ptr %T, ptr [[ARGS]]
419
437
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_TG0]], ptr [[ARGS]])
420
438
%tg0 = keypath $KeyPath<TG<T,U,V>, T>, <A,B,C> (root $TG<A,B,C>; stored_property #TG.a : $(A,B,C); tuple_element #0 : $A) <T,U,V>
439
+ strong_retain %tg0 : $KeyPath<TG<T,U,V>, T>
421
440
422
441
// CHECK: [[ARGS:%.*]] = alloca i{{.*}}
423
442
// CHECK: store ptr %T, ptr [[ARGS]]
424
443
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_TG1]], ptr [[ARGS]])
425
444
%tg1 = keypath $KeyPath<TG<T,U,V>, V>, <A,B,C> (root $TG<A,B,C>; stored_property #TG.a : $(A,B,C); tuple_element #2 : $C) <T,U,V>
445
+ strong_retain %tg1 : $KeyPath<TG<T,U,V>, V>
426
446
427
447
// CHECK: [[ARGS:%.*]] = alloca i{{.*}}
428
448
// CHECK: store ptr %T, ptr [[ARGS]]
429
449
// CHECK: call ptr @swift_getKeyPath(ptr [[KP_TG2]], ptr [[ARGS]])
430
450
%tg2 = keypath $KeyPath<TGA<T,U>, U>, <A,B> (root $TGA<A,B>; tuple_element #1 : $B) <T,U>
451
+ strong_retain %tg2 : $KeyPath<TGA<T,U>, U>
431
452
432
453
return undef : $()
433
454
}
434
455
435
456
sil @generic_class_stored_final : $@convention(thin) <T> () -> () {
436
457
entry:
437
458
%gcx = keypath $ReferenceWritableKeyPath<GC<T>, T>, <T> (root $GC<T>; stored_property #GC.x: $T) <T>
459
+ strong_retain %gcx : $ReferenceWritableKeyPath<GC<T>, T>
438
460
439
461
return undef : $()
440
462
}
@@ -542,6 +564,10 @@ entry(%0 : $*A, %1 : $*B, %2 : $*A, %3 : $*B, %4 : $*A, %5 : $*B):
542
564
indices_hash @s_hash : $@convention(keypath_accessor_hash) <T: Hashable, U: Hashable> (@in_guaranteed Int) -> Int
543
565
) <A, B> (%3, %4, %5)
544
566
567
+ strong_retain %s : $WritableKeyPath<A, B>
568
+ strong_retain %t : $WritableKeyPath<A, B>
569
+ strong_retain %v : $WritableKeyPath<A, A>
570
+
545
571
return undef : $()
546
572
}
547
573
0 commit comments