Skip to content

Conversation

@DougGregor
Copy link
Member

When defining a C-compatible function with @c, we were emitting a Swift function along with a C-compatible thunk. Stop doing that, and instead only produce the C-compatible function. All uses of the function will go through that C interface, just like if the function were declared in C.

This also applies to @c @implementation functions, which are declared in C but implemented in Swift. It does not apply to @_cdecl, which will continue to produce both the Swift function and C thunk to prevent an ABI break.

Fixes rdar://158888024.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

When defining a C-compatible function with `@c`, we were emitting a
Swift function along with a C-compatible thunk. Stop doing that, and
instead only produce the C-compatible function. All uses of the
function will go through that C interface, just like if the function
were declared in C.

This also applies to `@c @implementation` functions, which are
declared in C but implemented in Swift. It does *not* apply to
`@_cdecl`, which will continue to produce both the Swift function and
C thunk to prevent an ABI break.

Fixes rdar://158888024.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor enabled auto-merge October 18, 2025 02:43
@DougGregor DougGregor merged commit 1b2e6ad into swiftlang:main Oct 18, 2025
3 checks passed
@DougGregor DougGregor deleted the c-only-c-entrypoint branch October 18, 2025 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant