[PATCH] D49546: [clangd] Implement query iterators for Dex symbol index

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 20 07:19:16 PDT 2018


kbobyrev updated this revision to Diff 156483.
kbobyrev marked 9 inline comments as done.
kbobyrev added a comment.

- Switched from `std::shared_ptr` to `std::unique_ptr` for iterator's children: iterators own their subtrees, the lifetime should depend on the root
- Store `PostingListRef`in `DocumentIterator`: the lifetime of underlying `PostingList` should be longer than the `DocumentIterator` anyway, `DocumentIterator` can not retrieve results from an incomplete inverted index
- Refined API of different iterators: wipe `getIndex()`, `reset()` from `DocumentIterator`, `getChildren` from `AndIterator` and `OrIterator`
- Not exposing `DocumentIterator`, `AndIterator`, `OrIterator` to the User API anymore: helper functions like `std::unique_ptr<QueryIterator> constructDocumentIterator` which return a unique pointer and perform type erasure are provided instead
- Improved variable naming, applied refactorings where necessary


https://reviews.llvm.org/D49546

Files:
  clang-tools-extra/clangd/CMakeLists.txt
  clang-tools-extra/clangd/index/dex/QueryIterator.cpp
  clang-tools-extra/clangd/index/dex/QueryIterator.h
  clang-tools-extra/unittests/clangd/CMakeLists.txt
  clang-tools-extra/unittests/clangd/DexIndexTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49546.156483.patch
Type: text/x-patch
Size: 29181 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180720/75c65f4c/attachment-0001.bin>


More information about the cfe-commits mailing list