Skip to content

[cxx-interop] Avoid a ClangImporter dependency on Sema #61847

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 2 commits into from
Nov 2, 2022

Conversation

egorzhdan
Copy link
Contributor

@egorzhdan egorzhdan commented Nov 1, 2022

My recent change started linking ClangImporter with Sema, which accidentally introduced a circular dependency between the two.

This patch avoid the usage of type checker logic from ClangImporter's automatic protocol conformance logic.

rdar://101763817

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Nov 1, 2022
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

My recent change started linking ClangImporter with Sema, which accidentally introduced a circular dependency between the two.

This patch avoid the usage of type checker logic from ClangImporter's automatic protocol conformance logic.

rdar://101763817
@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-dependency-on-sema branch from 1b0c19e to 7f6fcf6 Compare November 1, 2022 18:18
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@tshortli tshortli left a comment

Choose a reason for hiding this comment

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

Thanks!

@tshortli

This comment was marked as resolved.

@tshortli

This comment was marked as resolved.

@egorzhdan
Copy link
Contributor Author

Thanks @tshortli! Let me reproduce and fix this locally.

@tshortli
Copy link
Contributor

tshortli commented Nov 1, 2022

Thanks @tshortli! Let me reproduce and fix this locally.

Thanks! Note that this will only reproduce on Linux, so if you're not set up to develop on Linux it may just be easier to let CI validate.

@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.

This LGTM.

For posterity: I feel like the layering violation here is on Sema. Sema should only depend on ClangModuleUnit, not the ClangImporter itself.

@tshortli

This comment was marked as resolved.

@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-dependency-on-sema branch from 0195f26 to 4bdd72f Compare November 1, 2022 21:25
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-dependency-on-sema branch from 4bdd72f to a7f00d6 Compare November 1, 2022 21:46
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan merged commit 145bf5f into main Nov 2, 2022
@egorzhdan egorzhdan deleted the egorzhdan/cxx-dependency-on-sema branch November 2, 2022 16:14
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.

4 participants