mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user