[SymbolGraph] Use isImplicitlyPrivate for extended types

This was just using `hasUnderscoredNaming` before but this only checks the
leafmost type. When filtering extended types, it should continue to look up
through nesting types to see if they are also implicitly private.

rdar://61843516
This commit is contained in:
Ashley Garland
2020-04-15 13:01:15 -07:00
parent 8324fedff1
commit 98d8eb9074
2 changed files with 11 additions and 3 deletions

View File

@@ -107,8 +107,9 @@ bool SymbolGraphASTWalker::walkToDeclPre(Decl *D, CharSourceRange Range) {
// potentially with generic requirements.
if (const auto *Extension = dyn_cast<ExtensionDecl>(D)) {
const auto *ExtendedNominal = Extension->getExtendedNominal();
auto ExtendedSG = getModuleSymbolGraph(ExtendedNominal);
// Ignore effecively private decls.
if (ExtendedNominal->hasUnderscoredNaming()) {
if (ExtendedSG->isImplicitlyPrivate(ExtendedNominal)) {
return false;
}
@@ -119,8 +120,6 @@ bool SymbolGraphASTWalker::walkToDeclPre(Decl *D, CharSourceRange Range) {
// If there are some protocol conformances on this extension, we'll
// grab them for some new conformsTo relationships.
if (!Extension->getInherited().empty()) {
auto ExtendedSG =
getModuleSymbolGraph(ExtendedNominal);
// The symbol graph to use to record these relationships.
SmallVector<const ProtocolDecl *, 4> Protocols;