[PATCH] D42049: [clangd] Merge results from static/dynamic index.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 15 04:26:37 PST 2018

hokein accepted this revision.
hokein added a comment.
This revision is now accepted and ready to land.

looks good.

Comment at: clangd/index/Merge.cpp:34
+         Dynamic->fuzzyFind(Ctx, Req, [&](const Symbol &S) { DynB.insert(S); });
+     SymbolSlab Dyn = std::move(DynB).build();
sammccall wrote:
> hokein wrote:
> > IIUC, `Dyn` is a local variable, which holds all the underlying data of `Symbol`, the `Symbol` returned in the callback of `fuzzyFind` would be invalid after the `fuzzyFind(..)` function call is finished.
> > 
> > Our previous assumption is that `Symbol` is valid as long as the `SymbolIndex` exists?
> > Our previous assumption is that Symbol is valid as long as the SymbolIndex exists?
> No, it's only valid for the callback. Valid for the life of the index would make life hard for remote indexes.
> Added documentation to SymbolIndex.
I see, that makes sense.

  rCTE Clang Tools Extra


More information about the cfe-commits mailing list