Skip to content

Make @_cdecl @implementation support __asm__ #70731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

beccadax
Copy link
Contributor

@beccadax beccadax commented Jan 5, 2024

When @_objcImplementation is used to implement a C function marked with __asm__, take the attribute into account when mangling SIL references.

In theory this change should also make clang::OverloadableAttr functions mangle correctly, but in practice the matching logic for @_cdecl @_objcImplementation doesn’t currently support overloadable functions (and it’s not wise to try anyway, since clang doesn’t promise that their ABI won’t change).

Fixes rdar://120503717.

When @_objcImplementation is used to implement a C function marked with __asm__, take the attribute into account when mangling SIL references.

In theory this change should also make `clang::OverloadableAttr` functions mangle correctly, but in practice the matching logic for @_cdecl @_objcImplementation doesn’t currently support overloadable functions (and it’s not wise to try anyway, since clang doesn’t promise that their ABI won’t change).

Fixes rdar://120503717.
@beccadax beccadax requested a review from tshortli January 5, 2024 02:27
@beccadax
Copy link
Contributor Author

beccadax commented Jan 5, 2024

@swift-ci please smoke test

@beccadax beccadax merged commit 33c7326 into swiftlang:main Jan 10, 2024
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