[PATCH] D82964: [clangd] Config: loading and caching config from disk.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 3 06:58:20 PDT 2020


sammccall added inline comments.


================
Comment at: clang-tools-extra/clangd/ConfigProvider.cpp:39
+    auto Buf = FS.getBufferForFile(Path);
+    // If stat() succeeds but we failed to read, retry once and cache failure.
+    if (!Buf)
----------------
kadircet wrote:
> why do we want to cache failure case for missing files ?
> 
> If it is truly missing and we didn't race with another process (likely git-checkout), the next stat will fail and we'll return a no-op fragment.
> If it was a race, we want to pick it up on the next run (and reading twice might not have enough of a delay in between), so why not just cache with a sentinel key in here too?
Yeah I was worried about a file we can stat but chronically can't read (e.g. because permissions are wrong). But this is probably not worth worrying about. Changed no not cache as you suggest.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82964





More information about the cfe-commits mailing list