mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Use the generic type lowering algorithm described in "docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion type to the type expected by the ABI. Change IRGen to use the swift calling convention (swiftcc) for native swift functions. Use the 'swiftself' attribute on self parameters and for closures contexts. Use the 'swifterror' parameter for swift error parameters. Change functions in the runtime that are called as native swift functions to use the swift calling convention. rdar://19978563
42 lines
1.2 KiB
Plaintext
42 lines
1.2 KiB
Plaintext
// RUN: %target-swift-frontend -module-name=test -Onone -emit-ir %s | %FileCheck %s
|
|
|
|
// CHECK-DAG: define linkonce_odr hidden swiftcc void @shared_external_test()
|
|
// CHECK-DAG: declare swiftcc void @public_external_test()
|
|
// CHECK-DAG: declare hidden swiftcc void @hidden_external_test()
|
|
// CHECK-NOT: public_external_unused_test
|
|
|
|
|
|
sil public_external @public_external_test : $@convention(thin) () -> () {
|
|
%0 = tuple()
|
|
return %0 : $()
|
|
}
|
|
|
|
sil hidden_external @hidden_external_test : $@convention(thin) () -> () {
|
|
%0 = tuple()
|
|
return %0 : $()
|
|
}
|
|
|
|
sil shared_external @shared_external_test : $@convention(thin) () -> () {
|
|
%0 = tuple()
|
|
return %0 : $()
|
|
}
|
|
|
|
sil public_external @public_external_unused_test : $@convention(thin) () -> () {
|
|
%0 = tuple()
|
|
return %0 : $()
|
|
}
|
|
|
|
sil public @use_all_symbols : $@convention(thin) () -> () {
|
|
%0 = function_ref @public_external_test : $@convention(thin) () -> ()
|
|
%1 = function_ref @hidden_external_test : $@convention(thin) () -> ()
|
|
%2 = function_ref @shared_external_test : $@convention(thin) () -> ()
|
|
|
|
apply %0() : $@convention(thin) () -> ()
|
|
apply %1() : $@convention(thin) () -> ()
|
|
apply %2() : $@convention(thin) () -> ()
|
|
|
|
%24 = tuple()
|
|
return %24 : $()
|
|
}
|
|
|