-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop][libswift] Use std::string
instead of BridgedStringRef
🚀
#39356
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
Something we'll need to do here is guard on the Swift version so we don't try to build with a version of the Swift compiler that can't import the C++ stdlib. |
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.
Is there a reason why you would the *_debugDescription
functions return a std::string and not a llvm::StringRef?
It's what's used in the swift compiler. Eventually we want to remove as much of this bridging as possible and just use |
Oh, and another reason (not a very good one but still): this allows us to not pull in any extra header includes which makes this patch simpler. I think it would be good to not touch any of the LLVM or Swift headers on the first go (other than the bridging headers which we already import and are pretty simpler). |
Yes, sorry, I mixed that up with |
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.
lgtm!
The first C-bridge to be removed! 🚀
a33f87a
to
f063701
Compare
@@ -81,6 +81,15 @@ extension BridgedStringRef { | |||
} | |||
} | |||
|
|||
extension std.__1.string { | |||
public var string: String { | |||
// TODO: remove this once a new version of Swift is released (and call |
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 guess Egor's patch for this didn't quite make it into 5.5 :(
@swift-ci please smoke test. |
@swift-ci please smoke test macOS. |
@swift-ci please test Windows. |
1 similar comment
@swift-ci please test Windows. |
No description provided.