Skip to content

Commit 6f52550

Browse files
committed
Add Swift function call ABI
Adds an unstable `extern "Swift"` ABI behind the `abi_swift` feature gate, mapping to LLVM's `swiftcc` calling convention. Cranelift and GCC backends fall back to the platform default since they have no equivalent.
1 parent 31a27ca commit 6f52550

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/abi.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ pub fn conv_to_fn_attribute<'gcc>(conv: CanonAbi, arch: &Arch) -> Option<FnAttri
245245
// possible to declare an `extern "custom"` block, so the backend still needs a calling
246246
// convention for declaring foreign functions.
247247
CanonAbi::Custom => return None,
248+
// gcc/gccjit does not have anything for Swift's calling convention.
249+
CanonAbi::Swift => panic!("gcc/gccjit backend does not support Swift calling convention"),
248250
CanonAbi::Arm(arm_call) => match arm_call {
249251
ArmCall::CCmseNonSecureCall => FnAttribute::ArmCmseNonsecureCall,
250252
ArmCall::CCmseNonSecureEntry => FnAttribute::ArmCmseNonsecureEntry,

0 commit comments

Comments
 (0)