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) {
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) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits