Files
rust/compiler/rustc_codegen_llvm/src
Jonathan Brouwer 0705b602f0 Rollup merge of #155815 - djc:swift-cc, r=jieyouxu
Add Swift function call ABI

Adds an unstable `extern "Swift"` ABI behind the `abi_swift` feature gate, mapping to LLVM's `swiftcc` calling convention. This is only allowed (a) for `is_darwin_like` targets, since the [ABI is only stable for those platforms](https://www.swift.org/blog/abi-stability-and-more/) and (b) with the LLVM backend, since the other backends don't support it.

Current approaches to interoperability with Swift lower to Objective-C (or require a Swift stub exposing a C ABI), but that is an optional mapping on the Swift side that some newer Apple frameworks omit. It would be great to be able to more directly/natively be able to call into Swift code directly via its stable API (on Apple platforms at least).

Reimplements rust-lang/rust#64582 on top of current main. The main objection to the previous PR seemed to be that it needed an RFC, but there was pushback (which seems sensible to me) that an RFC could be deferred until stabilization.

I think this needs a tracking issue? Would be happy to write one up if/when there is a consensus that this will be merged.
2026-05-13 15:16:17 +02:00
..
2026-05-12 17:09:19 +02:00
2026-03-31 09:06:31 +02:00
2025-11-11 18:34:47 -05:00
2026-04-12 23:33:27 +05:30