[PATCH] D51605: [clangd] SymbolOccurrences -> Refs and cleanup

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 4 04:55:02 PDT 2018


hokein accepted this revision.
hokein added a comment.

LGTM, thanks!



================
Comment at: clangd/index/FileIndex.cpp:120
+      auto &SymRefs = Sym.second;
+      std::sort(SymRefs.begin(), SymRefs.end());
+      std::copy(SymRefs.begin(), SymRefs.end(), back_inserter(RefsStorage));
----------------
sammccall wrote:
> hokein wrote:
> > So the sort is intended to make returned refs ordered?
> Yeah, I'm worried about the fact that we have no ranking at all, so the natural implementation of refs() with limit will return randomly different results after each dynamic index rebuild.
> Added a comment here, also happy to remove the sorting if you prefer.
Sounds good to me.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51605





More information about the cfe-commits mailing list