[SymbolGraphGen] don't use Clang modules in the "only re-export public symbols" check #66610
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.