[SymbolGraph] Don't link type identifier fragments to private symbols

These links will never resolve because the symbols are never emitted
in the first place.

rdar://64178490
This commit is contained in:
Ashley Garland
2020-08-07 12:31:16 -07:00
parent c6cd4b07b2
commit ecf8d556e5
4 changed files with 31 additions and 7 deletions

View File

@@ -138,7 +138,15 @@ void DeclarationFragmentPrinter::printTypeRef(Type T, const TypeDecl *RefTo,
openFragment(FragmentKind::TypeIdentifier);
printText(Name.str());
USR.clear();
if (Name.str() != "Self") {
auto ShouldLink = Name.str() != "Self";
if (const auto *TD = T->getAnyNominal()) {
if (SG->isImplicitlyPrivate(TD)) {
ShouldLink = false;
}
}
if (ShouldLink) {
llvm::raw_svector_ostream OS(USR);
ide::printDeclUSR(RefTo, OS);
}