[PATCH] D117792: [clangd][Background] Make index validation logs verbose

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 20 08:26:11 PST 2022

kadircet created this revision.
kadircet added a reviewer: sammccall.
Herald added subscribers: usaxena95, arphaman, kristof.beyls.
kadircet requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.

These errors are non-harmful and should be transient. They either

- compilation database returned stale results for TUs and it'll be fixed once it's updated to match project state.
- a TUs dependencies has changed and some headers no longer exist. this should be fixed with the next indexing cycle.

In either case the user will have some stale symbols in their index until clangd
restarts and the underlying issue is resolved. On the downside these logs are
confusing users when there's another issue.

  rG LLVM Github Monorepo



Index: clang-tools-extra/clangd/index/Background.cpp
--- clang-tools-extra/clangd/index/Background.cpp
+++ clang-tools-extra/clangd/index/Background.cpp
@@ -82,7 +82,7 @@
 bool shardIsStale(const LoadedShard &LS, llvm::vfs::FileSystem *FS) {
   auto Buf = FS->getBufferForFile(LS.AbsolutePath);
   if (!Buf) {
-    elog("Background-index: Couldn't read {0} to validate stored index: {1}",
+    vlog("Background-index: Couldn't read {0} to validate stored index: {1}",
          LS.AbsolutePath, Buf.getError().message());
     // There is no point in indexing an unreadable file.
     return false;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117792.401651.patch
Type: text/x-patch
Size: 667 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220120/b6011077/attachment-0001.bin>

More information about the cfe-commits mailing list