@@ -137,7 +142,8 @@
I.Parents.emplace_back(EmptySID, "F", InfoType::IT_record, PathTo);
I.VirtualParents.emplace_back(EmptySID, "G", InfoType::IT_record);
- I.ChildRecords.emplace_back(EmptySID, "ChildStruct", InfoType::IT_record);
+ I.ChildRecords.emplace_back(EmptySID, "ChildStruct", InfoType::IT_record,
+ "X/Y/Z/r");
I.ChildFunctions.emplace_back();
I.ChildFunctions.back().Name = "OneFunction";
I.ChildEnums.emplace_back();
@@ -215,7 +221,9 @@
Records
Functions
Index: clang-tools-extra/trunk/unittests/clang-doc/MergeTest.cpp
===================================================================
--- clang-tools-extra/trunk/unittests/clang-doc/MergeTest.cpp
+++ clang-tools-extra/trunk/unittests/clang-doc/MergeTest.cpp
@@ -87,7 +87,7 @@
One.Parents.emplace_back(EmptySID, "F", InfoType::IT_record);
One.VirtualParents.emplace_back(EmptySID, "G", InfoType::IT_record);
- One.ChildRecords.emplace_back(NonEmptySID, "ChildStruct",
+ One.ChildRecords.emplace_back(NonEmptySID, "SharedChildStruct",
InfoType::IT_record);
One.ChildFunctions.emplace_back();
One.ChildFunctions.back().Name = "OneFunction";
@@ -104,8 +104,8 @@
Two.TagType = TagTypeKind::TTK_Class;
- Two.ChildRecords.emplace_back(EmptySID, "OtherChildStruct",
- InfoType::IT_record);
+ Two.ChildRecords.emplace_back(NonEmptySID, "SharedChildStruct",
+ InfoType::IT_record, "path");
Two.ChildFunctions.emplace_back();
Two.ChildFunctions.back().Name = "TwoFunction";
Two.ChildEnums.emplace_back();
@@ -127,10 +127,8 @@
Expected->Parents.emplace_back(EmptySID, "F", InfoType::IT_record);
Expected->VirtualParents.emplace_back(EmptySID, "G", InfoType::IT_record);
- Expected->ChildRecords.emplace_back(NonEmptySID, "ChildStruct",
- InfoType::IT_record);
- Expected->ChildRecords.emplace_back(EmptySID, "OtherChildStruct",
- InfoType::IT_record);
+ Expected->ChildRecords.emplace_back(NonEmptySID, "SharedChildStruct",
+ InfoType::IT_record, "path");
Expected->ChildFunctions.emplace_back();
Expected->ChildFunctions.back().Name = "OneFunction";
Expected->ChildFunctions.back().USR = NonEmptySID;
Index: clang-tools-extra/trunk/unittests/clang-doc/SerializeTest.cpp
===================================================================
--- clang-tools-extra/trunk/unittests/clang-doc/SerializeTest.cpp
+++ clang-tools-extra/trunk/unittests/clang-doc/SerializeTest.cpp
@@ -407,12 +407,14 @@
RecordInfo *ParentB = InfoAsRecord(Infos[3].get());
RecordInfo ExpectedParentB(EmptySID);
- ExpectedParentB.ChildRecords.emplace_back(EmptySID, "B", InfoType::IT_record);
+ ExpectedParentB.ChildRecords.emplace_back(EmptySID, "B", InfoType::IT_record,
+ "A");
CheckRecordInfo(&ExpectedParentB, ParentB);
NamespaceInfo *ParentC = InfoAsNamespace(Infos[7].get());
NamespaceInfo ExpectedParentC(EmptySID);
- ExpectedParentC.ChildRecords.emplace_back(EmptySID, "C", InfoType::IT_record);
+ ExpectedParentC.ChildRecords.emplace_back(EmptySID, "C", InfoType::IT_record,
+ "@nonymous_namespace");
CheckNamespaceInfo(&ExpectedParentC, ParentC);
}
@@ -431,7 +433,7 @@
NamespaceInfo *ParentB = InfoAsNamespace(Infos[3].get());
NamespaceInfo ExpectedParentB(EmptySID);
ExpectedParentB.ChildNamespaces.emplace_back(EmptySID, "B",
- InfoType::IT_namespace);
+ InfoType::IT_namespace, "A");
CheckNamespaceInfo(&ExpectedParentB, ParentB);
}
Index: clang-tools-extra/trunk/unittests/clang-doc/YAMLGeneratorTest.cpp
===================================================================
--- clang-tools-extra/trunk/unittests/clang-doc/YAMLGeneratorTest.cpp
+++ clang-tools-extra/trunk/unittests/clang-doc/YAMLGeneratorTest.cpp
@@ -29,8 +29,9 @@
I.Namespace.emplace_back(EmptySID, "A", InfoType::IT_namespace);
I.ChildNamespaces.emplace_back(EmptySID, "ChildNamespace",
- InfoType::IT_namespace);
- I.ChildRecords.emplace_back(EmptySID, "ChildStruct", InfoType::IT_record);
+ InfoType::IT_namespace, "path/to/A/Namespace");
+ I.ChildRecords.emplace_back(EmptySID, "ChildStruct", InfoType::IT_record,
+ "path/to/A/Namespace");
I.ChildFunctions.emplace_back();
I.ChildFunctions.back().Name = "OneFunction";
I.ChildEnums.emplace_back();
@@ -53,9 +54,11 @@
ChildNamespaces:
- Type: Namespace
Name: 'ChildNamespace'
+ Path: 'path/to/A/Namespace'
ChildRecords:
- Type: Record
Name: 'ChildStruct'
+ Path: 'path/to/A/Namespace'
ChildFunctions:
- USR: '0000000000000000000000000000000000000000'
Name: 'OneFunction'
@@ -71,7 +74,7 @@
TEST(YAMLGeneratorTest, emitRecordYAML) {
RecordInfo I;
I.Name = "r";
- I.Path = "path/to/r";
+ I.Path = "path/to/A";
I.Namespace.emplace_back(EmptySID, "A", InfoType::IT_namespace);
I.DefLoc = Location(10, llvm::SmallString<16>{"test.cpp"});
@@ -85,7 +88,8 @@
I.VirtualParents.emplace_back(EmptySID, "G", InfoType::IT_record,
"path/to/G");
- I.ChildRecords.emplace_back(EmptySID, "ChildStruct", InfoType::IT_record);
+ I.ChildRecords.emplace_back(EmptySID, "ChildStruct", InfoType::IT_record,
+ "path/to/A/r");
I.ChildFunctions.emplace_back();
I.ChildFunctions.back().Name = "OneFunction";
I.ChildEnums.emplace_back();
@@ -101,7 +105,7 @@
R"raw(---
USR: '0000000000000000000000000000000000000000'
Name: 'r'
-Path: 'path/to/r'
+Path: 'path/to/A'
Namespace:
- Type: Namespace
Name: 'A'
@@ -129,6 +133,7 @@
ChildRecords:
- Type: Record
Name: 'ChildStruct'
+ Path: 'path/to/A/r'
ChildFunctions:
- USR: '0000000000000000000000000000000000000000'
Name: 'OneFunction'