-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[Swiftify] Add support for free functions imported as instance methods #84507
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 smoke test |
628fc8a
to
c1bf742
Compare
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke 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.
Looks great, left some small questions/nits inline.
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.
Thank you!
@swift-ci please smoke test |
4 similar comments
@swift-ci please smoke test |
@swift-ci please smoke test |
@swift-ci please smoke test |
@swift-ci please smoke test |
let args: [ExprSyntax] = base.signature.parameterClause.parameters.enumerated() | ||
.map { (i: Int, param: FunctionParameterSyntax) in | ||
return pointerArgs[i] ?? ExprSyntax("\(param.name)") | ||
if let overrideArg = pointerArgs[i] { |
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 wonder if this is a fix we want to backport to 6.2.
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 probably a good idea
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
51c8c99
to
801f900
Compare
@swift-ci please smoke test |
@swift-ci please smoke test |
This adds support for attaching safe interop wrappers to functions explicitly imported as instance methods using swift_name. rdar://156288883
While we handled prepending & to MutableSpan parameters, regular parameters that were unchanged during the transformation were not checked for inout-ness.
Since the compiler invokation performing the macro expansion dump redirects its stderr output, any errors are not displayed by default. This is extra problematic for test failures in CI. By performing the compiler invokation with -verify first, errors are shown.
8c4e699
to
f631365
Compare
@swift-ci please smoke test windows platform |
f631365
to
0c3db50
Compare
@swift-ci please smoke test |
@swift-ci please smoke test linux |
@swift-ci please smoke test macos |
…ethod [Swiftify] Add support for free functions imported as instance methods (cherry picked from commit ed4f058)
…ethod [Swiftify] Add support for free functions imported as instance methods (cherry picked from commit ed4f058)
This adds support for attaching safe interop wrappers to functions explicitly imported as instance methods using swift_name.
rdar://156288883