[PATCH] D51422: [clangd] Factor out the data-swapping functionality from MemIndex/DexIndex.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 30 09:24:00 PDT 2018

ioeric added inline comments.

Comment at: clangd/index/FileIndex.h:47
+  // The shared_ptr keeps the symbols alive.
+  std::shared_ptr<SymbolIndex> buildMemIndex();
Maybe avoid hardcoding the index name, so that we could potentially switch to use a different index implementation?

We might also want to allow user to specify different index implementations for file index e.g. main file dynamic index might prefer MemIndex while Dex might be a better choice for the preamble index. 

Comment at: clangd/index/MemIndex.h:30
+  /// Builds an index from a slab. The shared_ptr manages the slab's lifetime.
+  static std::shared_ptr<SymbolIndex> build(SymbolSlab Slab);
(It's a bit unfortunate that this has to return `shared_ptr` now)

  rCTE Clang Tools Extra


More information about the cfe-commits mailing list