Avatar
sil_stage canonical import Builtin import Swift import SwiftShims public protocol BaseP { func foo() } public protocol DerivedP : BaseP { func foo() } public struct Concrete : DerivedP { public func foo() init() } // main sil @main : $@convention(c) (Int32, UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>) -> Int32 { bb0(%0 : $Int32, %1 : $UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>): %2 = integer_literal $Builtin.Int32, 0 // user: %3 %3 = struct $Int32 (%2 : $Builtin.Int32) // user: %4 return %3 : $Int32 // id: %4 } // end sil function 'main' // Concrete.foo() sil @$S4main8ConcreteV3fooyyF : $@convention(method) (Concrete) -> () { // %0 // user: %1 bb0(%0 : $Concrete): debug_value %0 : $Concrete, let, name "self", argno 1 // id: %1 %2 = tuple () // user: %3 return %2 : $() // id: %3 } // end sil function '$S4main8ConcreteV3fooyyF' // protocol witness for DerivedP.foo() in conformance Concrete sil shared [transparent] [serialized] [thunk] @$S4main8ConcreteVAA8DerivedPA2aDP3fooyyFTW : $@convention(witness_method: DerivedP) (@in_guaranteed Concrete) -> () { // %0 // user: %1 bb0(%0 : $*Concrete): %1 = load %0 : $*Concrete // user: %3 // function_ref Concrete.foo() %2 = function_ref @$S4main8ConcreteV3fooyyF : $@convention(method) (Concrete) -> () // user: %3 %3 = apply %2(%1) : $@convention(method) (Concrete) -> () %4 = tuple () // user: %5 return %4 : $() // id: %5 } // end sil function '$S4main8ConcreteVAA8DerivedPA2aDP3fooyyFTW' // protocol witness for BaseP.foo() in conformance Concrete sil shared [transparent] [serialized] [thunk] @$S4main8ConcreteVAA5BasePA2aDP3fooyyFTW : $@convention(witness_method: BaseP) (@