Skip to content

Parser: Accept @cdecl with an optional identifier for a custom C name #82194

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Jun 11, 2025

Update the C++ and ASTGen parsers to accept @cdecl with an optional identifier argument for a custom C name. If no arguments are passed, the C name defaults to the name of the function with the attribute.

We still parse @_cdecl expecting a string argument.

The C++ parser still accepts strings as arguments for ease of landing this change. This can be lifted once other PRs are merged. We’ll also need a small change for @cdecl enums to behave properly without a custom C name.

xymus added 4 commits June 11, 2025 12:42
Begin accepting the attribute in the form of `@cdecl(cName)`, using an
identifier instead of a string.

For ease of landing this change we still accept the string form. We
should stop accepting it before making this feature available in
production.
@xymus
Copy link
Contributor Author

xymus commented Jun 11, 2025

@swift-ci Please smoke test

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