[PATCH] D50897: [clangd] Allow using experimental Dex index

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 20 06:05:34 PDT 2018


ioeric added inline comments.
Herald added a subscriber: kadircet.


================
Comment at: clang-tools-extra/clangd/index/Index.h:360
+ template <typename T>
+ static std::unique_ptr<SymbolIndex> build(SymbolSlab Slab) {
+   struct Snapshot {
----------------
I'd try to avoid this pattern as it implicitly requires `T::build(std::shared_ptr<std::vector<const Symbol *>>)` to be implemented. Alternatively, you could pull out a helper function that turns a `SymbolSlab` into `std::shared_ptr<std::vector<const Symbol *>>`, which can be shared by different indexes. It can probably live in `MemIndex.h`.


https://reviews.llvm.org/D50897





More information about the cfe-commits mailing list