Skip to content

[SymbolGraphGen] don't use Clang modules in the "only re-export public symbols" check #66610

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
Jun 15, 2023

Conversation

QuietMisdreavus
Copy link
Contributor

Resolves rdar://110399757

When symbols are checked for being "effectively private", there is a check to ensure that only public symbols from @_exported import modules are re-exported (to prevent internal symbols from the other module from appearing in the host module's symbol graph). However, this can mess up the "minimum access level" calculation when an underlying Clang module is present: Because there is an implicit @_exported import for the underlying Clang module, internal symbols in the Swift module are considered to be "re-exported" for the purposes of this check. This voids the previous "minimum access level" check, because in this case an internal symbol was meant to be considered for inclusion in the symbol graph!

This PR updates the "is this module export-imported" calculation by optionally forcing modules to be emitted from the same compiler, and then using this option in the above-mentioned calculation. This allows [-symbol-graph]-minimum-access-level to be used when there is also Clang code being built alongside the Swift module.

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please smoke test

@QuietMisdreavus QuietMisdreavus merged commit 85d59d2 into main Jun 15, 2023
@QuietMisdreavus QuietMisdreavus deleted the QuietMisdreavus/clang-minimum-access-level branch June 15, 2023 16:13
QuietMisdreavus added a commit that referenced this pull request Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants