This revision was automatically updated to reflect the committed changes.
Closed by commit rG671709f0e7d4: [clang][ExtractAPI] Add targetFallback to 
relationships in symbol graph (authored by dang).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136455/new/

https://reviews.llvm.org/D136455

Files:
  clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
  clang/test/ExtractAPI/anonymous_record_no_typedef.c
  clang/test/ExtractAPI/enum.c
  clang/test/ExtractAPI/objc_category.m
  clang/test/ExtractAPI/objc_interface.m
  clang/test/ExtractAPI/objc_property.m
  clang/test/ExtractAPI/objc_protocol.m
  clang/test/ExtractAPI/struct.c
  clang/test/ExtractAPI/underscored.c

Index: clang/test/ExtractAPI/underscored.c
===================================================================
--- clang/test/ExtractAPI/underscored.c
+++ clang/test/ExtractAPI/underscored.c
@@ -65,7 +65,8 @@
     {
       "kind": "memberOf",
       "source": "c:@S@ExposedRecord@FI@a",
-      "target": "c:@S@ExposedRecord"
+      "target": "c:@S@ExposedRecord",
+      "targetFallback": "ExposedRecord"
     }
   ],
   "symbols": [
Index: clang/test/ExtractAPI/struct.c
===================================================================
--- clang/test/ExtractAPI/struct.c
+++ clang/test/ExtractAPI/struct.c
@@ -52,22 +52,26 @@
     {
       "kind": "memberOf",
       "source": "c:@S@Color@FI@Red",
-      "target": "c:@S@Color"
+      "target": "c:@S@Color",
+      "targetFallback": "Color"
     },
     {
       "kind": "memberOf",
       "source": "c:@S@Color@FI@Green",
-      "target": "c:@S@Color"
+      "target": "c:@S@Color",
+      "targetFallback": "Color"
     },
     {
       "kind": "memberOf",
       "source": "c:@S@Color@FI@Blue",
-      "target": "c:@S@Color"
+      "target": "c:@S@Color",
+      "targetFallback": "Color"
     },
     {
       "kind": "memberOf",
       "source": "c:@S@Color@FI@Alpha",
-      "target": "c:@S@Color"
+      "target": "c:@S@Color",
+      "targetFallback": "Color"
     }
   ],
   "symbols": [
Index: clang/test/ExtractAPI/objc_protocol.m
===================================================================
--- clang/test/ExtractAPI/objc_protocol.m
+++ clang/test/ExtractAPI/objc_protocol.m
@@ -49,7 +49,8 @@
     {
       "kind": "conformsTo",
       "source": "c:objc(pl)AnotherProtocol",
-      "target": "c:objc(pl)Protocol"
+      "target": "c:objc(pl)Protocol",
+      "targetFallback": "Protocol"
     }
   ],
   "symbols": [
Index: clang/test/ExtractAPI/objc_property.m
===================================================================
--- clang/test/ExtractAPI/objc_property.m
+++ clang/test/ExtractAPI/objc_property.m
@@ -55,37 +55,44 @@
     {
       "kind": "memberOf",
       "source": "c:objc(cs)Interface(cpy)myInterfaceTypeProp",
-      "target": "c:objc(cs)Interface"
+      "target": "c:objc(cs)Interface",
+      "targetFallback": "Interface"
     },
     {
       "kind": "memberOf",
       "source": "c:objc(cs)Interface(py)myInterfaceInstanceProp",
-      "target": "c:objc(cs)Interface"
+      "target": "c:objc(cs)Interface",
+      "targetFallback": "Interface"
     },
     {
       "kind": "memberOf",
       "source": "c:objc(cs)Interface(cpy)myCategoryTypeProp",
-      "target": "c:objc(cs)Interface"
+      "target": "c:objc(cs)Interface",
+      "targetFallback": "Interface"
     },
     {
       "kind": "memberOf",
       "source": "c:objc(cs)Interface(py)myCategoryInstanceProp",
-      "target": "c:objc(cs)Interface"
+      "target": "c:objc(cs)Interface",
+      "targetFallback": "Interface"
     },
     {
       "kind": "conformsTo",
       "source": "c:objc(cs)Interface",
-      "target": "c:objc(pl)Protocol"
+      "target": "c:objc(pl)Protocol",
+      "targetFallback": "Protocol"
     },
     {
       "kind": "memberOf",
       "source": "c:objc(pl)Protocol(cpy)myProtocolTypeProp",
-      "target": "c:objc(pl)Protocol"
+      "target": "c:objc(pl)Protocol",
+      "targetFallback": "Protocol"
     },
     {
       "kind": "memberOf",
       "source": "c:objc(pl)Protocol(py)myProtocolInstanceProp",
-      "target": "c:objc(pl)Protocol"
+      "target": "c:objc(pl)Protocol",
+      "targetFallback": "Protocol"
     }
   ],
   "symbols": [
Index: clang/test/ExtractAPI/objc_interface.m
===================================================================
--- clang/test/ExtractAPI/objc_interface.m
+++ clang/test/ExtractAPI/objc_interface.m
@@ -57,37 +57,44 @@
     {
       "kind": "memberOf",
       "source": "c:objc(cs)Super(cm)getWithProperty:",
-      "target": "c:objc(cs)Super"
+      "target": "c:objc(cs)Super",
+      "targetFallback": "Super"
     },
     {
       "kind": "memberOf",
       "source": "c:objc(cs)Super(im)setProperty:andOtherThing:",
-      "target": "c:objc(cs)Super"
+      "target": "c:objc(cs)Super",
+      "targetFallback": "Super"
     },
     {
       "kind": "memberOf",
       "source": "c:objc(cs)Super(py)Property",
-      "target": "c:objc(cs)Super"
+      "target": "c:objc(cs)Super",
+      "targetFallback": "Super"
     },
     {
       "kind": "conformsTo",
       "source": "c:objc(cs)Super",
-      "target": "c:objc(pl)Protocol"
+      "target": "c:objc(pl)Protocol",
+      "targetFallback": "Protocol"
     },
     {
       "kind": "memberOf",
       "source": "c:objc(cs)Derived@Ivar",
-      "target": "c:objc(cs)Derived"
+      "target": "c:objc(cs)Derived",
+      "targetFallback": "Derived"
     },
     {
       "kind": "memberOf",
       "source": "c:objc(cs)Derived(im)getIvar",
-      "target": "c:objc(cs)Derived"
+      "target": "c:objc(cs)Derived",
+      "targetFallback": "Derived"
     },
     {
       "kind": "inheritsFrom",
       "source": "c:objc(cs)Derived",
-      "target": "c:objc(cs)Super"
+      "target": "c:objc(cs)Super",
+      "targetFallback": "Super"
     }
   ],
   "symbols": [
Index: clang/test/ExtractAPI/objc_category.m
===================================================================
--- clang/test/ExtractAPI/objc_category.m
+++ clang/test/ExtractAPI/objc_category.m
@@ -54,22 +54,26 @@
     {
       "kind": "memberOf",
       "source": "c:objc(cs)Interface(im)InstanceMethod",
-      "target": "c:objc(cs)Interface"
+      "target": "c:objc(cs)Interface",
+      "targetFallback": "Interface"
     },
     {
       "kind": "memberOf",
       "source": "c:objc(cs)Interface(cm)ClassMethod",
-      "target": "c:objc(cs)Interface"
+      "target": "c:objc(cs)Interface",
+      "targetFallback": "Interface"
     },
     {
       "kind": "memberOf",
       "source": "c:objc(cs)Interface(py)Property",
-      "target": "c:objc(cs)Interface"
+      "target": "c:objc(cs)Interface",
+      "targetFallback": "Interface"
     },
     {
       "kind": "conformsTo",
       "source": "c:objc(cs)Interface",
-      "target": "c:objc(pl)Protocol"
+      "target": "c:objc(pl)Protocol",
+      "targetFallback": "Protocol"
     }
   ],
   "symbols": [
Index: clang/test/ExtractAPI/enum.c
===================================================================
--- clang/test/ExtractAPI/enum.c
+++ clang/test/ExtractAPI/enum.c
@@ -65,57 +65,68 @@
     {
       "kind": "memberOf",
       "source": "c:@E@Vehicle@Bicycle",
-      "target": "c:@E@Vehicle"
+      "target": "c:@E@Vehicle",
+      "targetFallback": "Vehicle"
     },
     {
       "kind": "memberOf",
       "source": "c:@E@Vehicle@Car",
-      "target": "c:@E@Vehicle"
+      "target": "c:@E@Vehicle",
+      "targetFallback": "Vehicle"
     },
     {
       "kind": "memberOf",
       "source": "c:@E@Vehicle@Train",
-      "target": "c:@E@Vehicle"
+      "target": "c:@E@Vehicle",
+      "targetFallback": "Vehicle"
     },
     {
       "kind": "memberOf",
       "source": "c:@E@Vehicle@Ship",
-      "target": "c:@E@Vehicle"
+      "target": "c:@E@Vehicle",
+      "targetFallback": "Vehicle"
     },
     {
       "kind": "memberOf",
       "source": "c:@E@Vehicle@Airplane",
-      "target": "c:@E@Vehicle"
+      "target": "c:@E@Vehicle",
+      "targetFallback": "Vehicle"
     },
     {
       "kind": "memberOf",
       "source": "c:@E@Direction@North",
-      "target": "c:@E@Direction"
+      "target": "c:@E@Direction",
+      "targetFallback": "Direction"
     },
     {
       "kind": "memberOf",
       "source": "c:@E@Direction@East",
-      "target": "c:@E@Direction"
+      "target": "c:@E@Direction",
+      "targetFallback": "Direction"
     },
     {
       "kind": "memberOf",
       "source": "c:@E@Direction@South",
-      "target": "c:@E@Direction"
+      "target": "c:@E@Direction",
+      "targetFallback": "Direction"
     },
     {
       "kind": "memberOf",
       "source": "c:@E@Direction@West",
-      "target": "c:@E@Direction"
+      "target": "c:@E@Direction",
+      "targetFallback": "Direction"
     },
     {
       "kind": "memberOf",
       "source": "c:@Ea@Constant@Constant",
-      "target": "c:@Ea@Constant"
+      "target": "c:@Ea@Constant",
+      "targetFallback": "enum (unnamed)"
     },
     {
       "kind": "memberOf",
       "source": "c:@Ea@OtherConstant@OtherConstant",
-      "target": "c:@Ea@OtherConstant"
+      "target": "c:@Ea@OtherConstant",
+      "targetFallback": "enum (unnamed)"
     }
   ],
   "symbols": [
Index: clang/test/ExtractAPI/anonymous_record_no_typedef.c
===================================================================
--- clang/test/ExtractAPI/anonymous_record_no_typedef.c
+++ clang/test/ExtractAPI/anonymous_record_no_typedef.c
@@ -56,22 +56,26 @@
     {
       "kind": "memberOf",
       "source": "c:@S@Vehicle@E@input.h@64@Bicycle",
-      "target": "c:@S@Vehicle@E@input.h@64"
+      "target": "c:@S@Vehicle@E@input.h@64",
+      "targetFallback": "Vehicle::enum (unnamed)"
     },
     {
       "kind": "memberOf",
       "source": "c:@S@Vehicle@E@input.h@64@Car",
-      "target": "c:@S@Vehicle@E@input.h@64"
+      "target": "c:@S@Vehicle@E@input.h@64",
+      "targetFallback": "Vehicle::enum (unnamed)"
     },
     {
       "kind": "memberOf",
       "source": "c:@S@Vehicle@FI@type",
-      "target": "c:@S@Vehicle"
+      "target": "c:@S@Vehicle",
+      "targetFallback": "Vehicle"
     },
     {
       "kind": "memberOf",
       "source": "c:@S@Vehicle@FI@information",
-      "target": "c:@S@Vehicle"
+      "target": "c:@S@Vehicle",
+      "targetFallback": "Vehicle"
     }
   ],
   "symbols": [
Index: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
===================================================================
--- clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
+++ clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
@@ -559,6 +559,7 @@
   Object Relationship;
   Relationship["source"] = Source.USR;
   Relationship["target"] = Target.USR;
+  Relationship["targetFallback"] = Target.Name;
   Relationship["kind"] = getRelationshipString(Kind);
 
   Relationships.emplace_back(std::move(Relationship));
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to