[PATCH] D135231: [clangd] Don't clone SymbolSlab::Builder arenas when finalizing.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 5 11:59:05 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG6ea83fc98fd1: [clangd] Don't clone SymbolSlab::Builder arenas when finalizing. (authored by sammccall).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135231

Files:
  clang-tools-extra/clangd/index/Symbol.cpp


Index: clang-tools-extra/clangd/index/Symbol.cpp
===================================================================
--- clang-tools-extra/clangd/index/Symbol.cpp
+++ clang-tools-extra/clangd/index/Symbol.cpp
@@ -61,12 +61,9 @@
     SortedSymbols.push_back(std::move(Entry.second));
   llvm::sort(SortedSymbols,
              [](const Symbol &L, const Symbol &R) { return L.ID < R.ID; });
-  // We may have unused strings from overwritten symbols. Build a new arena.
-  llvm::BumpPtrAllocator NewArena;
-  llvm::UniqueStringSaver Strings(NewArena);
-  for (auto &S : SortedSymbols)
-    own(S, Strings);
-  return SymbolSlab(std::move(NewArena), std::move(SortedSymbols));
+  // We may have unused strings from overwritten symbols.
+  // In practice, these are extremely small, it's not worth compacting.
+  return SymbolSlab(std::move(Arena), std::move(SortedSymbols));
 }
 
 llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const SymbolSlab &Slab) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135231.465495.patch
Type: text/x-patch
Size: 956 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221005/272b8734/attachment-0001.bin>


More information about the cfe-commits mailing list