[PATCH] D56592: [clangd] Fix updated file detection logic in indexing

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 14 05:21:37 PST 2019


kadircet added inline comments.


================
Comment at: clangd/index/Background.cpp:309
   for (const auto &I : *Index.Sources) {
+    // We already have the map from uris to absolutepaths in the cache,
+    // therefore traverse Index.Sources rather than Files to get rid of absolute
----------------
ilya-biryukov wrote:
> If this the only reason we're traversing `Index.Sources`? If so, I suggest removing this comment and traversing `Files` instead.
> This would make the code more straightforward and would definitely cost us only a negligible performance penalty.
Well actually, in addition to that I was traversing source files rather than updated files to make sure we write down shards even for sources without any symbols or refs in them. Because current logic in `FileFilter` didn't take files without any symbols into account.

So this is actually rather about detecting if a file is already up-to-date or not, changing that logic to take new files without any symbols into account.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D56592





More information about the cfe-commits mailing list