-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[wasm] Add support for __builtin_va_list type mapping #84029
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
Conversation
Cover all va_list family of types just aliased by __builtin_va_list, including __isoc_va_list from wasi-libc. This enables proper C interop for variable argument functions on WASI targets.
|
@swift-ci smoke test |
| @@ -0,0 +1,18 @@ | |||
| // RUN: %swift-frontend -target wasm32-unknown-wasip1 -parse-stdlib -module-name Swift -I %S/Inputs/custom-modules -typecheck %s | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a test that always checks with Wasm target because the alias issue happens only for targets where __builtin_va_list is defined as void * by Clang (TargetInfo::BuiltinVaListKind::VoidPtrBuiltinVaList).
|
@kateinoigakukun Would you have a moment to cherry-pick it for 6.2 after this PR is merged? |
|
Yeap, I can do it if we want. |
Cover all va_list family of types just aliased by __builtin_va_list, including __isoc_va_list from wasi-libc. This enables proper C interop for variable argument functions on WASI targets. Close swiftlang#72398 # Conflicts: # test/ClangImporter/Inputs/custom-modules/module.modulemap
This PR removes a workaround on WASI where we were avoiding a call to `withVaList()` because it miscompiled there. That problem was fixed by swiftlang/swift#84029 and cherry-picked to 6.2.
This PR removes a workaround on WASI where we were avoiding a call to `withVaList()` because it miscompiled there. That problem was fixed by swiftlang/swift#84029. It was cherry-picked to 6.2, but does not appear to be fixed in 6.2 CI, so the change here only applies to 6.3 onward. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
Cover all va_list family of types just aliased by __builtin_va_list, including __isoc_va_list from wasi-libc. This enables proper C interop for variable argument functions on WASI targets.
Close #72398