[PATCH] D82891: [clangd] Fix race in FileIndex that sometimes temporarily lost updates.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 1 02:39:52 PDT 2020


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/index/FileIndex.h:97
 
+  unsigned Version = 0;
   llvm::StringMap<std::shared_ptr<SymbolSlab>> SymbolsSnapshot;
----------------
oh and also maybe use `size_t` ?

as there's only one (well three actually, if you count both preamble and main-file index separately, and one in background-index) instance of `FileSymbols` for a single clangd instance, hence we could in theory bump this number with every keystroke :/

I suppose 4 bytes is also far from any practical limits, but pushing it as far as possible wouldn't hurt?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82891





More information about the cfe-commits mailing list