Index: clang-tools-extra/clang-doc/Representation.h =================================================================== --- clang-tools-extra/clang-doc/Representation.h +++ clang-tools-extra/clang-doc/Representation.h @@ -238,6 +238,8 @@ Info(InfoType IT, SymbolID USR) : USR(USR), IT(IT) {} Info(InfoType IT, SymbolID USR, StringRef Name) : USR(USR), IT(IT), Name(Name) {} + Info(InfoType IT, SymbolID USR, StringRef Name, StringRef Path) + : USR(USR), IT(IT), Name(Name), Path(Path) {} Info(const Info &Other) = delete; Info(Info &&Other) = default; @@ -269,6 +271,8 @@ NamespaceInfo(SymbolID USR) : Info(InfoType::IT_namespace, USR) {} NamespaceInfo(SymbolID USR, StringRef Name) : Info(InfoType::IT_namespace, USR, Name) {} + NamespaceInfo(SymbolID USR, StringRef Name, StringRef Path) + : Info(InfoType::IT_namespace, USR, Name, Path) {} void merge(NamespaceInfo &&I); @@ -287,6 +291,7 @@ SymbolInfo(InfoType IT) : Info(IT) {} SymbolInfo(InfoType IT, SymbolID USR) : Info(IT, USR) {} SymbolInfo(InfoType IT, SymbolID USR, StringRef Name) : Info(IT, USR, Name) {} + SymbolInfo(InfoType IT, SymbolID USR, StringRef Name, StringRef Path) : Info(IT, USR, Name, Path) {} void merge(SymbolInfo &&I); @@ -318,6 +323,8 @@ RecordInfo(SymbolID USR) : SymbolInfo(InfoType::IT_record, USR) {} RecordInfo(SymbolID USR, StringRef Name) : SymbolInfo(InfoType::IT_record, USR, Name) {} + RecordInfo(SymbolID USR, StringRef Name, StringRef Path) + : SymbolInfo(InfoType::IT_record, USR, Name, Path) {} void merge(RecordInfo &&I); Index: clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp =================================================================== --- clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp +++ clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp @@ -83,6 +83,7 @@ void CheckBaseInfo(Info *Expected, Info *Actual) { EXPECT_EQ(size_t(20), Actual->USR.size()); EXPECT_EQ(Expected->Name, Actual->Name); + EXPECT_EQ(Expected->Path, Actual->Path); ASSERT_EQ(Expected->Namespace.size(), Actual->Namespace.size()); for (size_t Idx = 0; Idx < Actual->Namespace.size(); ++Idx) CheckReference(Expected->Namespace[Idx], Actual->Namespace[Idx]); Index: clang-tools-extra/unittests/clang-doc/SerializeTest.cpp =================================================================== --- clang-tools-extra/unittests/clang-doc/SerializeTest.cpp +++ clang-tools-extra/unittests/clang-doc/SerializeTest.cpp @@ -91,7 +91,7 @@ CheckNamespaceInfo(&ExpectedA, A); NamespaceInfo *B = InfoAsNamespace(Infos[2].get()); - NamespaceInfo ExpectedB(EmptySID, "B"); + NamespaceInfo ExpectedB(EmptySID, /*Name=*/"B", /*Path=*/"A"); ExpectedB.Namespace.emplace_back(EmptySID, "A", InfoType::IT_namespace); CheckNamespaceInfo(&ExpectedB, B); @@ -276,7 +276,7 @@ CheckRecordInfo(&ExpectedE, E); RecordInfo *G = InfoAsRecord(Infos[2].get()); - RecordInfo ExpectedG(EmptySID, "G"); + RecordInfo ExpectedG(EmptySID, /*Name=*/"G", /*Path=*/"E"); ExpectedG.DefLoc = Location(0, llvm::SmallString<16>{"test.cpp"}); ExpectedG.TagType = TagTypeKind::TTK_Class; ExpectedG.Namespace.emplace_back(EmptySID, "E", InfoType::IT_record);