File: generic_classes_objc.sil

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (96 lines) | stat: -rw-r--r-- 3,756 bytes parent folder | download
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
// RUN: %empty-directory(%t)
// RUN: %build-irgen-test-overlays
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) %s -emit-ir | %FileCheck %s

// REQUIRES: CPU=i386 || CPU=x86_64
// REQUIRES: objc_interop

import Builtin
import Swift
import gizmo

// CHECK: @"$s20generic_classes_objc19GenericInheritsObjCCMP"

class GenericInheritsObjC<D> : Gizmo {
  var a : Int
  var x : D
  var z : Int

  override init()
}
sil_vtable GenericInheritsObjC {}

// __deallocating_deinit
sil @$s20generic_classes_objc19GenericInheritsObjCCfD : $@convention(method) <T> (GenericInheritsObjC<T>) -> () {
bb0(%0 : $GenericInheritsObjC<T>):
  unreachable
}

// @objc init
sil @$s20generic_classes_objc19GenericInheritsObjCCACyxGycfcTo : $@convention(objc_method) <T> (@owned GenericInheritsObjC<T>) -> @owned GenericInheritsObjC<T> {
bb0(%0 : $GenericInheritsObjC<T>):
  unreachable
}

sil @$s20generic_classes_objc19GenericInheritsObjCC7bellsOnACyxGSgSi_tcfcTo : $@convention(objc_method) <T> (Int, @owned GenericInheritsObjC<T>) -> @owned GenericInheritsObjC<T> {
bb0(%0 : $Int, %1 : $GenericInheritsObjC<T>):
  unreachable
}

// CHECK: @"$s20generic_classes_objc20GenericInheritsObjC2CMP"

class GenericInheritsObjC2<E> : Gizmo {
  var x : UInt8
  var y : E
  var z : UInt8

  override init()
}
sil_vtable GenericInheritsObjC2 {}

// __deallocating_deinit
sil @$s20generic_classes_objc20GenericInheritsObjC2CfD : $@convention(method) <T> (GenericInheritsObjC2<T>) -> () {
bb0(%0 : $GenericInheritsObjC2<T>):
  unreachable
}

// @objc init
sil @$s20generic_classes_objc20GenericInheritsObjC2CACyxGycfcTo : $@convention(objc_method) <T> (@owned GenericInheritsObjC2<T>) -> @owned GenericInheritsObjC2<T> {
bb0(%0 : $GenericInheritsObjC2<T>):
  unreachable
}

sil @$s20generic_classes_objc20GenericInheritsObjC2C7bellsOnACyxGSgSi_tcfcTo : $@convention(objc_method) <T> (Int, @owned GenericInheritsObjC<T>) -> @owned GenericInheritsObjC<T> {
bb0(%0 : $Int, %1 : $GenericInheritsObjC<T>):
  unreachable
}

@objc protocol P1 { }
protocol P2 { }

// CHECK: @"$s20generic_classes_objc16Generic3WithReqsCMn" = hidden constant
// CHECK-SAME: i16 3, i16 3, i16 5, i16 0
class Generic3WithReqs<T: P1, U: P2, V: P2> { }
sil_vtable Generic3WithReqs { }


class SomeClass{}
sil_vtable SomeClass {}

// This used to assert.
sil @repo : $@convention(thin) (@guaranteed Optional< @callee_guaranteed @substituted <τ_0_1 where τ_0_1 : Copyable, τ_0_1 : Escapable> (@in_guaranteed Result<τ_0_1, Error>) -> () for <ObjcGenericClass<SomeClass>>>) -> () {
bb0(%0 : $Optional< @callee_guaranteed @substituted <τ_0_1 where τ_0_1 : Copyable, τ_0_1 : Escapable> (@in_guaranteed Result<τ_0_1, Error>) -> () for <ObjcGenericClass<SomeClass>> >):
  debug_value %0 : $Optional<@callee_guaranteed @substituted <τ_0_1 where τ_0_1 : Copyable, τ_0_1 : Escapable> (@in_guaranteed Result<τ_0_1, Error>) -> () for <ObjcGenericClass<SomeClass>>>, let, name "completion", argno 1
  %2 = tuple ()
  return %2 : $()
}

struct PlainGeneric<T> {}

// This used to assert.
sil @repo2 : $@convention(thin) (@guaranteed Optional< @callee_guaranteed @substituted <τ_0_1 where τ_0_1 : Copyable, τ_0_1 : Escapable> (@in_guaranteed Result<τ_0_1, Error>) -> () for <PlainGeneric<ObjcGenericClass<SomeClass>>>>) -> () {
bb0(%0 : $Optional< @callee_guaranteed @substituted <τ_0_1 where τ_0_1 : Copyable, τ_0_1 : Escapable> (@in_guaranteed Result<τ_0_1, Error>) -> () for <PlainGeneric<ObjcGenericClass<SomeClass>>> >):
  debug_value %0 : $Optional<@callee_guaranteed @substituted <τ_0_1 where τ_0_1 : Copyable, τ_0_1 : Escapable> (@in_guaranteed Result<τ_0_1, Error>) -> () for <PlainGeneric<ObjcGenericClass<SomeClass>>>>, let, name "completion", argno 1
  %2 = tuple ()
  return %2 : $()
}