[clangd] Rename edge name for filesymbols to slabs in memorytree

This was causing duplicate `symbols` components on the path as both the
edge from an index to filesymbols and filesymbols to symbolslabs were named
symbols.

Differential Revision: https://reviews.llvm.org/D89685
This commit is contained in:
Kadir Cetinkaya 2020-10-19 12:33:35 +02:00
parent a704d8238c
commit 4074914103
No known key found for this signature in database
GPG Key ID: E39E36B8D2057ED6
5 changed files with 8 additions and 8 deletions

View File

@ -416,7 +416,7 @@ BackgroundIndex::loadProject(std::vector<std::string> MainFiles) {
}
void BackgroundIndex::profile(MemoryTree &MT) const {
IndexedSymbols.profile(MT.child("symbols"));
IndexedSymbols.profile(MT.child("slabs"));
// We don't want to mix memory used by index and symbols, so call base class.
MT.child("index").addUsage(SwapIndex::estimateMemoryUsage());
}

View File

@ -478,11 +478,11 @@ void FileIndex::updateMain(PathRef Path, ParsedAST &AST) {
}
void FileIndex::profile(MemoryTree &MT) const {
PreambleSymbols.profile(MT.child("preamble").child("symbols"));
PreambleSymbols.profile(MT.child("preamble").child("slabs"));
MT.child("preamble")
.child("index")
.addUsage(PreambleIndex.estimateMemoryUsage());
MainFileSymbols.profile(MT.child("main_file").child("symbols"));
MainFileSymbols.profile(MT.child("main_file").child("slabs"));
MT.child("main_file")
.child("index")
.addUsage(MainFileIndex.estimateMemoryUsage());

View File

@ -22,7 +22,7 @@
# CHECK-NEXT: "_self": {{[0-9]+}},
# CHECK-NEXT: "_total": {{[0-9]+}}
# CHECK-NEXT: },
# CHECK-NEXT: "symbols": {
# CHECK-NEXT: "slabs": {
# CHECK-NEXT: "{{.*}}main.cpp": {
# CHECK-NEXT: "_self": {{[0-9]+}},
# CHECK-NEXT: "_total": {{[0-9]+}},
@ -50,7 +50,7 @@
# CHECK-NEXT: "_self": {{[0-9]+}},
# CHECK-NEXT: "_total": {{[0-9]+}}
# CHECK-NEXT: },
# CHECK-NEXT: "symbols": {
# CHECK-NEXT: "slabs": {
# CHECK-NEXT: "_self": {{[0-9]+}},
# CHECK-NEXT: "_total": {{[0-9]+}}
# CHECK-NEXT: }

View File

@ -927,7 +927,7 @@ TEST(BackgroundIndex, Profile) {
MemoryTree MT(&Alloc);
Idx.profile(MT);
ASSERT_THAT(MT.children(),
UnorderedElementsAre(Pair("symbols", _), Pair("index", _)));
UnorderedElementsAre(Pair("slabs", _), Pair("index", _)));
}
} // namespace clangd

View File

@ -672,9 +672,9 @@ TEST(FileIndexTest, Profile) {
UnorderedElementsAre(Pair("preamble", _), Pair("main_file", _)));
ASSERT_THAT(MT.child("preamble").children(),
UnorderedElementsAre(Pair("index", _), Pair("symbols", _)));
UnorderedElementsAre(Pair("index", _), Pair("slabs", _)));
ASSERT_THAT(MT.child("main_file").children(),
UnorderedElementsAre(Pair("index", _), Pair("symbols", _)));
UnorderedElementsAre(Pair("index", _), Pair("slabs", _)));
ASSERT_THAT(MT.child("preamble").child("index").total(), Gt(0U));
ASSERT_THAT(MT.child("main_file").child("index").total(), Gt(0U));