You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the long-term success of this project, it should allow for exposing functions in Rust that can be called in Swift via the Swift function ABI as well as calling functions declared in Swift directly from Rust without an intermediate C or Objective-C layer. LLVM currently supports the Swift calling convention, also known as swiftcc. In order to expose Swift functions and call them directly in an FFI-safe manner, the Rust compiler needs to be taught Swift's function call ABI.
rust-lang/rust#64582 implements the basic function ABI in rustc via LLVM. This would allow for:
One thing of note is that there is a definite difference between "the Swift calling convention" and swiftcc, as mentioned in this llvm thread, in particular swiftcc uses the llvm / backend support for struct aggregates, while "the Swift calling convention", pre-expands or indirects all structs before llvm.
A particular example is that these functions are ABI equivalent according to "the Swift calling convention" as stated here in the aforementioned thread.
struct A { i32, float };
struct B { float, i32 };define@foo (A, i32) -> @foo(i32, float, i32);
// anddefine@foo (i32, B) -> @foo(i32, float, i32);
For the long-term success of this project, it should allow for exposing functions in Rust that can be called in Swift via the Swift function ABI as well as calling functions declared in Swift directly from Rust without an intermediate C or Objective-C layer. LLVM currently supports the Swift calling convention, also known as
swiftcc
. In order to expose Swift functions and call them directly in an FFI-safe manner, the Rust compiler needs to be taught Swift's function call ABI.rust-lang/rust#64582 implements the basic function ABI in
rustc
via LLVM. This would allow for:The text was updated successfully, but these errors were encountered: