mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SymbolGraph: Don't unconditionally add edge targets to the graph
Edge targets might point outside the module, so don't include them unconditionally. rdar://58876107
This commit is contained in:
@@ -139,7 +139,12 @@ void SymbolGraph::recordEdge(const ValueDecl *Source,
|
||||
}
|
||||
|
||||
Nodes.insert(Source);
|
||||
Nodes.insert(Target);
|
||||
if (Target->getModuleContext() != &M) {
|
||||
// Don't claim a symbol just because we have a relationship to it.
|
||||
// For example, if we conform to `Sequence`, that symbol's node should be
|
||||
// under Swift, not this module.
|
||||
Nodes.insert(Target);
|
||||
}
|
||||
|
||||
Edges.insert({this, Kind, Source, Target});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user