-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] Enable foreign reference types in C interop #82680
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
base: main
Are you sure you want to change the base?
Conversation
@swift-ci please test |
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.
LG!
@@ -864,11 +864,6 @@ def cxx_interoperability_mode : | |||
SwiftSynthesizeInterfaceOption]>, | |||
HelpText<"Enables C++ interoperability; pass 'default' to enable or 'off' to disable">; | |||
|
|||
def experimental_c_foreign_reference_types : |
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.
I don't have a strong feeling here, but in case someone used this their build now would fail due to unknown argument. Should we make it deprecated/noop for one release? I am also OK just removing it straight away.
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.
Yeah, that's a fair point, I just don't think anyone uses this flag at the moment. But I also don't feel strongly.
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.
I'd rather leave the flag and ignore it (or emit a deprecation message). I've mentioned this flag in various places, so I wouldn't be surprised if it was used somewhere.
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.
Sounds good, I brought back the flag, with a deprecation note.
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.
Other deprecated flags also trigger a diag::warn_flag_deprecated
diagnostic. I think we should do the same.
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.
Done!
The flag is being removed in the compiler: swiftlang/swift#82680. C foreign reference types will now be available unconditionally. rdar://150308819
The flag is being removed in the compiler: swiftlang/swift#82680. C foreign reference types will now be available unconditionally. rdar://150308819
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.
Excellent!
@@ -864,11 +864,6 @@ def cxx_interoperability_mode : | |||
SwiftSynthesizeInterfaceOption]>, | |||
HelpText<"Enables C++ interoperability; pass 'default' to enable or 'off' to disable">; | |||
|
|||
def experimental_c_foreign_reference_types : |
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.
I'd rather leave the flag and ignore it (or emit a deprecation message). I've mentioned this flag in various places, so I wouldn't be surprised if it was used somewhere.
6349f78
to
e801f0d
Compare
@swift-ci please test |
Most of the logic for C++ foreign reference types can be applied to C types as well. Swift had a compiler flag `-Xfrontend -experimental-c-foreign-reference-types` for awhile now which enables foreign reference types without having to enable C++ interop. This change makes it the default behavior. Since we don't expect anyone to pass `experimental-c-foreign-reference-types` currently, this also removes the frontend flag. rdar://150308819
e801f0d
to
9178af3
Compare
@swift-ci please test |
@swift-ci please test Linux |
@swift-ci please test macOS |
@swift-ci please test |
@swift-ci please test Windows |
@swift-ci please test Windows |
Most of the logic for C++ foreign reference types can be applied to C types as well. Swift had a compiler flag
-Xfrontend -experimental-c-foreign-reference-types
for awhile now which enables foreign reference types without having to enable C++ interop. This change makes it the default behavior.Since we don't expect anyone to pass
experimental-c-foreign-reference-types
currently, this also removes the frontend flag.rdar://150308819