[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 12 08:17:09 PDT 2018


ioeric accepted this revision.
ioeric added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clangd/index/Background.cpp:51
+      std::unique_lock<std::mutex> Lock(QueueMu);
+      assert(!HasActiveTask);
+      QueueCV.wait(Lock, [&] { return ShouldStop || !Queue.empty(); });
----------------
Maybe generalize this to `NumActiveTasks`? Currently, this is single-threaded and safe, but it could be missed when we add more threads.


================
Comment at: unittests/clangd/BackgroundIndexTests.cpp:14
+
+TEST(BackgroundIndexTest, IndexesOneFile) {
+  MockFSProvider FS;
----------------
Also add a test for `enqueueAll` with multiple TUs ?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53032





More information about the cfe-commits mailing list