Skip to content

Import member operator functions as static members #32293

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

Merged
merged 17 commits into from
Jul 3, 2020
Merged

Import member operator functions as static members #32293

merged 17 commits into from
Jul 3, 2020

Conversation

MForster
Copy link
Contributor

@MForster MForster commented Jun 10, 2020

This adds support to ClangImporter to import C++ member function operators as static methods into Swift.

The left-hand-side operand, which gets passed as the this pointer to the C++ function is represented as an additional first parameter in the Swift method. It gets mapped back in SILGen.

@MForster MForster added the c++ interop Feature: Interoperability with C++ label Jun 10, 2020
@MForster MForster requested a review from gribozavr June 10, 2020 09:05
@MForster MForster self-assigned this Jun 10, 2020
Copy link
Contributor Author

@MForster MForster left a comment

Choose a reason for hiding this comment

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

This is now in a state where I'd be mostly happy with it. Some tests need fixing for non-Linux platforms, but I think it is ready for review.

@MForster MForster marked this pull request as ready for review June 15, 2020 15:08
@swiftlang swiftlang deleted a comment from swift-ci Jun 15, 2020
@swiftlang swiftlang deleted a comment from swift-ci Jun 15, 2020
@swiftlang swiftlang deleted a comment from swift-ci Jun 16, 2020
MForster and others added 5 commits June 16, 2020 16:29
Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
@swiftlang swiftlang deleted a comment from swift-ci Jun 16, 2020
Copy link
Contributor Author

@MForster MForster left a comment

Choose a reason for hiding this comment

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

I've addressed the remaining issues. I think this is now ready for merging.

@gribozavr can you take another look before I merge?

@MForster
Copy link
Contributor Author

MForster commented Jul 2, 2020

@swift-ci please test

@swiftlang swiftlang deleted a comment from swift-ci Jul 2, 2020
@swiftlang swiftlang deleted a comment from swift-ci Jul 3, 2020
@swift-ci
Copy link
Contributor

swift-ci commented Jul 3, 2020

Build failed
Swift Test OS X Platform
Git Sha - 43bac74

@MForster MForster merged commit 26358c4 into swiftlang:master Jul 3, 2020
@MForster MForster deleted the m/op/member branch July 3, 2020 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants