Skip to content

libswift: replace use of std::string with char * #40299

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

Closed

Conversation

compnerd
Copy link
Member

This replaces the use of C++ interop with C bindings for the string
bridging. This change ensures that the interop can be used on all
platforms, including those where the ABI concerns with C++ have not yet
been addressed.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

This replaces the use of C++ interop with C bindings for the string
bridging.  This change ensures that the interop can be used on all
platforms, including those where the ABI concerns with C++ have not yet
been addressed.
@compnerd
Copy link
Member Author

CC: @eeckstein @zoecarver

@compnerd
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 167de8e

@eeckstein
Copy link
Contributor

eeckstein commented Nov 26, 2021

Why not just revert f063701?

Copy link
Contributor

@zoecarver zoecarver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not merge this PR before we have a proper discussion about whether this is the right path to resolve the issues you're discussing.

What specific ABI issues are you seeing with std::string on Windows? For both ctors (which are not used in libSwift) and copy-ctors, we ask clang for the function signature/ABI to ensure that we match that and emit a thunk where needed.


If we're going to do this, I agree with Erik, let's use what was there before, it's much better (matches the other string bridging and is platform agnostic).

@compnerd
Copy link
Member Author

Okay, but we need to get this sorted out for now. Lets revert the other change for now.

@eeckstein
Copy link
Contributor

I have a PR for the revert (which is also need for unblocking CMO work): #40607

@zoecarver
Copy link
Contributor

Okay, but we need to get this sorted out for now. Lets revert the other change for now.

Sorry, I somehow missed this comment. @compnerd can you please explain the issue you're running into. I'd really like to avoid reverting this change.

@compnerd compnerd closed this Dec 21, 2021
@compnerd compnerd deleted the unsupported-feature-removal branch December 21, 2021 14:51
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.

4 participants