[PATCH] D82964: [clangd] Config: loading and caching config from disk.
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 3 03:12:19 PDT 2020
kadircet 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)
----------------
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?
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