Slide 40
Slide 40 text
// main()
sil hidden @$s6code034mainyyF : $@convention(thin) () -> () {
bb0:
%0 = metatype $@thick A.Type // user: %2
// function_ref A.__allocating_init()
%1 = function_ref @$s6code031ACACycfC : $@convention(method) (@thick A.Type) -> @owned A // user: %2
%2 = apply %1(%0) : $@convention(method) (@thick A.Type) -> @owned A // users: %5, %4, %3
%3 = class_method %2 : $A, #A.f!1 : (A) -> () -> (), $@convention(method) (@guaranteed A) -> () // user: %4
%4 = apply %3(%2) : $@convention(method) (@guaranteed A) -> ()
strong_release %2 : $A // id: %5
%6 = metatype $@thick B.Type // user: %8
// function_ref B.__allocating_init()
%7 = function_ref @$s6code031BCACycfC : $@convention(method) (@thick B.Type) -> @owned B // user: %8
%8 = apply %7(%6) : $@convention(method) (@thick B.Type) -> @owned B // users: %11, %10, %9
%9 = class_method %8 : $B, #B.f!1 : (B) -> () -> (), $@convention(method) (@guaranteed B) -> () // user: %10
%10 = apply %9(%8) : $@convention(method) (@guaranteed B) -> ()
strong_release %8 : $B // id: %11
%12 = metatype $@thick B.Type // user: %14
// function_ref B.__allocating_init()
%13 = function_ref @$s6code031BCACycfC : $@convention(method) (@thick B.Type) -> @owned B // user: %14
%14 = apply %13(%12) : $@convention(method) (@thick B.Type) -> @owned B // user: %15
%15 = upcast %14 : $B to $A // users: %18, %17, %16
%16 = class_method %15 : $A, #A.f!1 : (A) -> () -> (), $@convention(method) (@guaranteed A) -> () // user: %17
%17 = apply %16(%15) : $@convention(method) (@guaranteed A) -> ()
strong_release %15 : $A // id: %18
%19 = metatype $@thick C.Type // user: %21
// function_ref C.__allocating_init()
%20 = function_ref @$s6code031CCACycfC : $@convention(method) (@thick C.Type) -> @owned C // user: %21
%21 = apply %20(%19) : $@convention(method) (@thick C.Type) -> @owned C // user: %23
%22 = alloc_stack $C // users: %23, %27, %26, %25
store %21 to %22 : $*C // id: %23
// function_ref P.f()
%24 = function_ref @$s6code031PPAAE1fyyF : $@convention(method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> () // user: %25
%25 = apply %24(%22) : $@convention(method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> ()
destroy_addr %22 : $*C // id: %26
dealloc_stack %22 : $*C // id: %27
%28 = metatype $@thick D.Type // user: %30
// function_ref D.__allocating_init()
%29 = function_ref @$s6code031DCACycfC : $@convention(method) (@thick D.Type) -> @owned D // user: %30
%30 = apply %29(%28) : $@convention(method) (@thick D.Type) -> @owned D // users: %33, %32, %31
%31 = class_method %30 : $D, #D.f!1 : (D) -> () -> (), $@convention(method) (@guaranteed D) -> () // user: %32
%32 = apply %31(%30) : $@convention(method) (@guaranteed D) -> ()
strong_release %30 : $D // id: %33
%34 = metatype $@thick D.Type // user: %36
// function_ref D.__allocating_init()
%35 = function_ref @$s6code031DCACycfC : $@convention(method) (@thick D.Type) -> @owned D // user: %36
%36 = apply %35(%34) : $@convention(method) (@thick D.Type) -> @owned D // user: %37
%37 = upcast %36 : $D to $C // user: %39
%38 = alloc_stack $C // users: %39, %43, %42, %41
store %37 to %38 : $*C // id: %39
// function_ref P.f()
%40 = function_ref @$s6code031PPAAE1fyyF : $@convention(method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> () // user: %41
%41 = apply %40<(C)>(%38) : $@convention(method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> ()
destroy_addr %38 : $*C // id: %42
dealloc_stack %38 : $*C // id: %43
%44 = tuple () // user: %45
return %44 : $() // id: %45
} // end sil function '$s6code034mainyyF'
40