Avatar
sil_stage canonical import Builtin import Swift import SwiftShims public protocol P { func foo() func bar() } extension P { public func foo() } // 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' // P.foo() sil private [transparent] [thunk] @_T04main1PP3fooyyF : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> () { // %0 // user: %2 bb0(%0 : $*τ_0_0): // function_ref P.foo() %1 = function_ref @_T04main1PPAAE3fooyyF : $@convention(method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> () // user: %2 %2 = apply %1<τ_0_0>(%0) : $@convention(method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> () %3 = tuple () // user: %4 return %3 : $() // id: %4 } // end sil function '_T04main1PP3fooyyF' // P.foo() sil @_T04main1PPAAE3fooyyF : $@convention(method) <Self where Self : P> (@in_guaranteed Self) -> () { // %0 // user: %1 bb0(%0 : $*Self): debug_value_addr %0 : $*Self, let, name "self", argno 1 // id: %1 %2 = tuple () // user: %3 return %2 : $() // id: %3 } // end sil function '_T04main1PPAAE3fooyyF' sil_default_witness_table P { method #P.foo!1: <Self where Self : P> (Self) -> () -> () : @_T04main1PP3fooyyF // main.P.foo() -> () no_default }