[PATCH] D92381: [clangd] Extract per-dir CDB cache to its own threadsafe class. NFC

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 1 03:57:11 PST 2020


sammccall added inline comments.


================
Comment at: clang-tools-extra/clangd/GlobalCompilationDatabase.cpp:89
+  // Has cache been filled from disk? FIXME: this should be an expiry time.
+  bool CachePopulated = false;
+  // Whether a new CDB has been loaded but not broadcast yet.
----------------
All these members feel pretty messy, there's definitely some redundancy (e.g. `CachePopulated` is equivalent to `CDB || FinalizedNoCDB` at the moment).

Basically this is an intermediate state: CachePopulated will become the validity time of the cached value (which *is* meaningful when CDB is set).

I can try to polish this code in its own right, or optimize for a smooth transition to cache/expiry, but probably not both at once.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92381



More information about the cfe-commits mailing list