[clang][ExtractAPI] Add targetFallback to relationships in symbol graph

Adds a 'targetFallback' field to relationships in symbol graph that
contains the plain name of the relationship target. This is useful for
clients when the relationship target symbol is not available.

Differential Revision: https://reviews.llvm.org/D136455
This commit is contained in:
Daniel Grumberg
2022-10-21 15:34:57 +01:00
parent 8f68952183
commit 671709f0e7
9 changed files with 79 additions and 39 deletions

View File

@@ -559,6 +559,7 @@ void SymbolGraphSerializer::serializeRelationship(RelationshipKind Kind,
Object Relationship;
Relationship["source"] = Source.USR;
Relationship["target"] = Target.USR;
Relationship["targetFallback"] = Target.Name;
Relationship["kind"] = getRelationshipString(Kind);
Relationships.emplace_back(std::move(Relationship));