[PATCH] D64712: [clangd] Refactor background-index shard loading

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 18 08:16:33 PDT 2019


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/index/BackgroundIndexLoader.cpp:93
+
+void BackgroundIndexLoader::load(PathRef MainFile,
+                                 BackgroundIndexStorage *Storage) {
----------------
kadircet wrote:
> sammccall wrote:
> > This handles only one main file, I can't see where you skip loading shards for headers that were loaded for a previous file
> The real loading happens down the line at `const CachedShard &CS = loadShard(ShardIdentifier, Storage);`, which returns shard from cache if it was already loaded.
OK, then we still traverse the whole subtree but hit every node.

I think it'd be nicer to avoid the traversal (as noted above) if that works well, up to you.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64712





More information about the cfe-commits mailing list