[clang-tools-extra] [clangd] Add background index format support to clangd-indexer (PR #175209)

Jason Williams via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 17 02:37:14 PDT 2026


jasonwilliams wrote:

I've made some changes in response to @HighCommander4's review

- Removed IndexActionFactoryBase, the shared base class is gone. IndexActionFactory is now a standalone class (restored to its pre-PR state) with direct member builders (`SymbolSlab::Builder Symbols`, etc.) rather than unique_ptrs.
- Rewrote ShardedIndexActionFactory:
  - No more merging between TUs, each IndexFileIn from the createStaticIndexingAction callback is passed directly to FileShardedIndex
  - No SymbolSlab::Builder / RefSlab::Builder / RelationSlab::Builder objects, slabs go straight from the callback into FileShardedIndex
  - Shards are written directly from the createStaticIndexingAction callback (no more runInvocation override needed for the shard-writing logic)
- Added header shard deduplication, ShardVersions (a StringMap<ShardVersion>) tracks the content digest of each shard we've  written. Before each TU is indexed, create() snapshots this map. writeShards() then only writes shards for files whose digest differs from the snapshot, mirroring exactly how BackgroundIndex::update() avoids re-writing unchanged header shards.
- Moved ShardVersion to namespace scope

if anyone can test these latest changes, that would be useful

https://github.com/llvm/llvm-project/pull/175209


More information about the cfe-commits mailing list