[PATCH] D51982: [clangd] Introduce PostingList interface

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 13 09:53:15 PDT 2018


kbobyrev added inline comments.


================
Comment at: clang-tools-extra/clangd/index/dex/Iterator.h:39
 #include <vector>
+#include "PostingList.h"
 
----------------
kbobyrev wrote:
> sammccall wrote:
> > Why this dep? Seems circular
> `Iterator` interface uses `DocID`, so I guess it should depend on `PostingList.h`, shouldn't it?
FWIW I tried to get rid of this dependency in the first place, but it seemed pretty hard, because the options I saw were either forward declaring (which isn't possible since it's practically typedef) it or introducing another `using DocID = uint32_t` in `Iterator.h`, which I decided not to do because of the code duplication. Another option would be to make both `PostingList.h` and `Iterator.h` depend on some common file, but semantically `DocID` seems to belong to the `Iterator.h`, so I didn't think that would be a good solution, too.

Is there something I could do to resolve that?


https://reviews.llvm.org/D51982





More information about the cfe-commits mailing list