mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SymbolGraph: Use getAllInheritedProtocols()
This commit is contained in:
@@ -492,14 +492,10 @@ void SymbolGraph::recordConformanceRelationships(Symbol S) {
|
||||
const auto D = S.getLocalSymbolDecl();
|
||||
if (const auto *NTD = dyn_cast<NominalTypeDecl>(D)) {
|
||||
if (auto *PD = dyn_cast<ProtocolDecl>(NTD)) {
|
||||
PD->walkInheritedProtocols([&](ProtocolDecl *inherited) {
|
||||
if (inherited != PD) {
|
||||
recordEdge(S, Symbol(this, inherited, nullptr),
|
||||
RelationshipKind::ConformsTo(), nullptr);
|
||||
}
|
||||
|
||||
return TypeWalker::Action::Continue;
|
||||
});
|
||||
for (auto *inherited : PD->getAllInheritedProtocols()) {
|
||||
recordEdge(S, Symbol(this, inherited, nullptr),
|
||||
RelationshipKind::ConformsTo(), nullptr);
|
||||
}
|
||||
} else {
|
||||
for (const auto *Conformance : NTD->getAllConformances()) {
|
||||
// Check to make sure that this conformance wasn't declared via an
|
||||
|
||||
Reference in New Issue
Block a user