-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add -enable-cxx-interop flag and support for extern "C" {} #25870
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
@swift-ci please test |
Exposed only as a frontend flag. |
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.
Looks pretty solid for an initial start! There's one serious comment in here (in SwiftStddef.h) and then a bunch of small things.
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test linux |
Build failed |
@swift-ci please test linux |
Build failed |
Hmm. Looks like Interpreter/withoutActuallyEscaping.swift is randomly failing quite a bit now. |
@atrick, did something get messed up on Linux? Or recently fixed on Linux? |
The withoutActuallyAliasing test was failing when optimization runs (even though it's an Interpreter test, apparently it runs with optimizations sometimes). |
@swift-ci test linux |
It's a supported configuration to run the JIT with optimizations. |
This is an attempt to get the basic c++ interop working in a flag protected fashion.
Here a forum post for more context: https://forums.swift.org/t/c-interop/25567.
Some context on the changes:
The existing swift header files assume that c means that it is the swift compiler and c++ means that it is just clang. This changes them to also use the swift to properly support inclusion from swift in c++ mode. There will probably be other libraries which need support to compile in c++ mode, but this is enough to make the basic tests pass.
Also, support for extern "C" {} is needed to get anywhere with the current headers, so add that as well.