[5.7-04182022][SymbolGraphGen] skip underscored implicit Clang decls #42497
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.
This is a cherry-pick of #42493 onto
release/5.7-04182022
.Explanation: When generating symbol graphs for projects with a precompiled header and a minimum-access-level of
internal
, several implicit Clang decls started appearing after #41156 stopped unanimously filtering out underscore-prefixed symbols. This PR filters out implicit Clang decls with underscore-prefixed names, as they're unlikely to be useful to consumers of symbol graphs.Scope: The change is isolated to SymbolGraphGen, and due to the behavior of underscored symbol filtering, should only affect symbol graphs where the minimum access level is set to
internal
or below.Radar: rdar://92018648
Risk: Low. This won't affect normal compilation. The impact on symbol graphs is minimal; only implicit Clang decls in specific circumstances are filtered out.
Testing: A new lit test,
SymbolGraph/ClangImporter/BridgingHeader.swift
, has been added to verify that using a precompiled header does not add three specific decls otherwise added by Clang.