[PATCH] D53433: [clangd] auto-index stores symbols per-file instead of per-TU.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 5 08:42:52 PST 2018


ioeric added inline comments.


================
Comment at: clangd/index/Background.cpp:235
+    IndexedFileDigests[Path] = FilesToUpdate.lookup(Path);
+    IndexedSymbols.update(Path,
+                          make_unique<SymbolSlab>(std::move(Syms).build()),
----------------
kadircet wrote:
> This call is already thread-safe, no need for it to be under lock.
This is for making sure that the update of digest and index data is atomic. If FileSymbols update is not in the lock, we might get the wrong digest for the indexed symbols in corner cases (e.g. T1 updates digest -> T2 updates digest -> T2 update symbols -> T1 updates symbols ). 


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53433





More information about the cfe-commits mailing list