File: inlinecaches_invalidate_failure.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 (108 lines) | stat: -rw-r--r-- 5,153 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
97
98
99
100
101
102
103
104
105
106
107
108
// RUN: %target-sil-opt -enable-sil-verify-all %s -inline -specdevirt -code-sinking  -sil-verify-without-invalidation

sil_stage canonical

import Builtin
import Swift

public class Foo {
  deinit
  func doSomething() -> Foo
  init()
}

public class Foo2 : Foo {
  deinit
  override func doSomething() -> Foo
  override init()
}

// test.Foo.doSomething (test.Foo)() -> test.Foo
sil hidden_external @_TFC4test3Foo11doSomethingfS0_FT_S0_ : $@convention(method) (@guaranteed Foo) -> @owned Foo

// test.Foo.init (test.Foo.Type)() -> test.Foo
sil hidden_external @_TFC4test3FoocfMS0_FT_S0_ : $@convention(method) (@owned Foo) -> @owned Foo

// test.Foo2.doSomething (test.Foo2)() -> test.Foo
sil hidden @_TFC4test4Foo211doSomethingfS0_FT_CS_3Foo : $@convention(method) (@guaranteed Foo2) -> @owned Foo {
bb0(%0 : $Foo2):
  debug_value %0 : $Foo2                          // id: %1
  strong_retain %0 : $Foo2                        // id: %2
  %3 = upcast %0 : $Foo2 to $Foo                  // user: %4
  return %3 : $Foo                                // id: %4
}

// test.Foo2.__deallocating_deinit
sil @_TFC4test4Foo2D : $@convention(method) (@owned Foo2) -> () {
bb0(%0 : $Foo2):
  debug_value %0 : $Foo2                          // id: %1
  %2 = upcast %0 : $Foo2 to $Foo                  // user: %4
  // function_ref test.Foo.deinit
  %3 = function_ref @_TFC4test3Food : $@convention(method) (@guaranteed Foo) -> @owned Builtin.NativeObject // user: %4
  %4 = apply %3(%2) : $@convention(method) (@guaranteed Foo) -> @owned Builtin.NativeObject // user: %5
  %5 = unchecked_ref_cast %4 : $Builtin.NativeObject to $Foo2 // user: %6
  dealloc_ref %5 : $Foo2                          // id: %6
  %7 = tuple ()                                   // user: %8
  return %7 : $()                                 // id: %8
}

// test.Foo2.deinit
sil @_TFC4test4Foo2d : $@convention(method) (@guaranteed Foo2) -> @owned Builtin.NativeObject {
bb0(%0 : $Foo2):
  debug_value %0 : $Foo2                          // id: %1
  %2 = upcast %0 : $Foo2 to $Foo                  // user: %4
  // function_ref test.Foo.deinit
  %3 = function_ref @_TFC4test3Food : $@convention(method) (@guaranteed Foo) -> @owned Builtin.NativeObject // user: %4
  %4 = apply %3(%2) : $@convention(method) (@guaranteed Foo) -> @owned Builtin.NativeObject // user: %5
  return %4 : $Builtin.NativeObject               // id: %5
}

// test.Foo.deinit
sil @_TFC4test3Food : $@convention(method) (@guaranteed Foo) -> @owned Builtin.NativeObject

// test.Foo2.init (test.Foo2.Type)() -> test.Foo2
sil hidden @_TFC4test4Foo2cfMS0_FT_S0_ : $@convention(method) (@owned Foo2) -> @owned Foo2 {
bb0(%0 : $Foo2):
  %1 = alloc_stack $Foo2                          // users: %2, %6, %9, %10
  store %0 to %1 : $*Foo2                       // id: %2
  %3 = upcast %0 : $Foo2 to $Foo                  // user: %7
  // function_ref test.Foo.init (test.Foo.Type)() -> test.Foo
  %4 = function_ref @_TFC4test3FoocfMS0_FT_S0_ : $@convention(method) (@owned Foo) -> @owned Foo // user: %7
  %7 = apply %4(%3) : $@convention(method) (@owned Foo) -> @owned Foo // user: %8
  %8 = unchecked_ref_cast %7 : $Foo to $Foo2      // users: %9, %11
  store %8 to %1 : $*Foo2                       // id: %9
  dealloc_stack %1 : $*Foo2      // id: %10
  return %8 : $Foo2                               // id: %11
}

// test.Foo2.__allocating_init (test.Foo2.Type)() -> test.Foo2
sil hidden @_TFC4test4Foo2CfMS0_FT_S0_ : $@convention(thin) (@thick Foo2.Type) -> @owned Foo2 {
bb0(%0 : $@thick Foo2.Type):
  %1 = alloc_ref $Foo2                            // users: %3, %4
  %2 = alloc_stack $Foo2                          // users: %3, %7, %10, %11
  store %1 to %2 : $*Foo2                       // id: %3
  %4 = upcast %1 : $Foo2 to $Foo                  // user: %8
  // function_ref test.Foo.init (test.Foo.Type)() -> test.Foo
  %5 = function_ref @_TFC4test3FoocfMS0_FT_S0_ : $@convention(method) (@owned Foo) -> @owned Foo // user: %8
  %8 = apply %5(%4) : $@convention(method) (@owned Foo) -> @owned Foo // user: %9
  %9 = unchecked_ref_cast %8 : $Foo to $Foo2      // users: %10, %12
  store %9 to %2 : $*Foo2                       // id: %10
  dealloc_stack %2 : $*Foo2      // id: %11
  return %9 : $Foo2                               // id: %12
}

// test.main (test.Foo) -> test.Foo
sil hidden @_TF4test4mainFCS_3FooS0_ : $@convention(thin) (@owned Foo) -> @owned Foo {
bb0(%0 : $Foo):
  debug_value %0 : $Foo                           // id: %1
  %2 = class_method %0 : $Foo, #Foo.doSomething : (Foo) -> () -> Foo, $@convention(method) (@guaranteed Foo) -> @owned Foo // user: %3
  %3 = apply %2(%0) : $@convention(method) (@guaranteed Foo) -> @owned Foo // user: %5
  strong_release %0 : $Foo                        // id: %4
  return %3 : $Foo                                // id: %5
}

sil_vtable Foo2 {
  #Foo.doSomething: @_TFC4test4Foo211doSomethingfS0_FT_CS_3Foo	// test.Foo2.doSomething (test.Foo2)() -> test.Foo
  #Foo.init!initializer: @_TFC4test4Foo2cfMS0_FT_S0_	// test.Foo2.init (test.Foo2.Type)() -> test.Foo2
  #Foo2.deinit!deallocator: @_TFC4test4Foo2D	// test.Foo2.__deallocating_deinit
}