Skip to content

[cxx-interop] Emit IR for virtual methods #61828

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 1 commit into from
Nov 2, 2022
Merged

Conversation

egorzhdan
Copy link
Contributor

Even if a virtual method is not used directly from Swift, it might get emitted into the vtable, and in that case the IR for it should be emitted to avoid linker errors.

Fixes #61730.

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Oct 31, 2022
@egorzhdan egorzhdan requested review from hyp and zoecarver October 31, 2022 20:09
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-ir-virtual branch from 78574c5 to 4e343ea Compare October 31, 2022 23:32
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-ir-virtual branch from 4e343ea to 7b7c010 Compare October 31, 2022 23:35
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

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.

Looks great, thanks!

@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-ir-virtual branch from 7b7c010 to 71e5ce7 Compare November 1, 2022 00:52
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

Even if a virtual method is not used directly from Swift, it might get emitted into the vtable, and in that case the IR for it should be emitted to avoid linker errors.

Fixes #61730.
@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-ir-virtual branch from 71e5ce7 to 6ca60b0 Compare November 1, 2022 20:11
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@hyp hyp left a comment

Choose a reason for hiding this comment

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

Thanks!

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test macOS

@ktoso
Copy link
Contributor

ktoso commented Nov 1, 2022

Hooray! 🥳

@egorzhdan egorzhdan merged commit f02b298 into main Nov 2, 2022
@egorzhdan egorzhdan deleted the egorzhdan/cxx-ir-virtual branch November 2, 2022 00:51
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.

[cxx-interop] IRGen and collect referenced local functions from functions emitted into a vtable
4 participants