Skip to content

Swift Function Call ABI #3

Open
@nvzqz

Description

@nvzqz

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:

extern "Swift" {
    fn foo();
}

extern "Swift" fn bar() {
    // ...
}

type F = extern "Swift" fn();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions