mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This reflects the fact that the attribute's only for compiler-internal use, and isn't really equivalent to C's asm attribute, since it doesn't change the calling convention to be C-compatible.
23 lines
1007 B
Plaintext
23 lines
1007 B
Plaintext
import Swift
|
|
|
|
@_silgen_name("public_func") public func public_func<T>() -> T?
|
|
|
|
|
|
sil public_external @impl_func : $@convention(thin) <T> (@out Optional<T>) -> ()
|
|
|
|
sil shared [fragile] @shared_func : $@convention(thin) <T> (@out Optional<T>) -> () {
|
|
bb0(%0 : $*Optional<T>):
|
|
%1 = function_ref @impl_func : $@convention(thin) <τ_0_0> (@out Optional<τ_0_0>) -> () // user: %2
|
|
%2 = apply %1<T>(%0) : $@convention(thin) <τ_0_0> (@out Optional<τ_0_0>) -> ()
|
|
%3 = tuple () // user: %4
|
|
return %3 : $() // id: %4
|
|
}
|
|
|
|
sil public [fragile] @public_func : $@convention(thin) <T> (@out Optional<T>) -> () {
|
|
bb0(%0 : $*Optional<T>):
|
|
%1 = function_ref @shared_func : $@convention(thin) <τ_0_0> (@out Optional<τ_0_0>) -> () // user: %2
|
|
%2 = apply %1<T>(%0) : $@convention(thin) <τ_0_0> (@out Optional<τ_0_0>) -> ()
|
|
%3 = tuple () // user: %4
|
|
return %3 : $() // id: %4
|
|
}
|