[clang-tools-extra] 4074914 - [clangd] Rename edge name for filesymbols to slabs in memorytree
Kadir Cetinkaya via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 19 07:18:40 PDT 2020
Author: Kadir Cetinkaya
Date: 2020-10-19T16:09:46+02:00
New Revision: 40749141030b8172b8490ebbdcd0d3440cbe041b
URL: https://github.com/llvm/llvm-project/commit/40749141030b8172b8490ebbdcd0d3440cbe041b
DIFF: https://github.com/llvm/llvm-project/commit/40749141030b8172b8490ebbdcd0d3440cbe041b.diff
LOG: [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
Added:
Modified:
clang-tools-extra/clangd/index/Background.cpp
clang-tools-extra/clangd/index/FileIndex.cpp
clang-tools-extra/clangd/test/memory_tree.test
clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
clang-tools-extra/clangd/unittests/FileIndexTests.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/index/Background.cpp b/clang-tools-extra/clangd/index/Background.cpp
index 4779cb8d4c23..1649bffea2ed 100644
--- a/clang-tools-extra/clangd/index/Background.cpp
+++ b/clang-tools-extra/clangd/index/Background.cpp
@@ -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());
}
diff --git a/clang-tools-extra/clangd/index/FileIndex.cpp b/clang-tools-extra/clangd/index/FileIndex.cpp
index 587c7eb78170..9a376df8dfec 100644
--- a/clang-tools-extra/clangd/index/FileIndex.cpp
+++ b/clang-tools-extra/clangd/index/FileIndex.cpp
@@ -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());
diff --git a/clang-tools-extra/clangd/test/memory_tree.test b/clang-tools-extra/clangd/test/memory_tree.test
index 41efdfb49e7a..c0a6aaf266ab 100644
--- a/clang-tools-extra/clangd/test/memory_tree.test
+++ b/clang-tools-extra/clangd/test/memory_tree.test
@@ -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: }
diff --git a/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp b/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
index 4f089519530a..cc0ca6f54a7f 100644
--- a/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
+++ b/clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
@@ -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
diff --git a/clang-tools-extra/clangd/unittests/FileIndexTests.cpp b/clang-tools-extra/clangd/unittests/FileIndexTests.cpp
index 2b20b7e7fef0..4abe0bf5e5dc 100644
--- a/clang-tools-extra/clangd/unittests/FileIndexTests.cpp
+++ b/clang-tools-extra/clangd/unittests/FileIndexTests.cpp
@@ -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));
More information about the cfe-commits
mailing list