[PATCH] D95451: [clangd] references: decls of overrides of x are refs to x, not decls

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 26 10:01:05 PST 2021


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

thanks, lgtm!



================
Comment at: clang-tools-extra/clangd/XRefs.cpp:1406
+  Req.Limit = Limit;
+  auto QueryIndex = [&](bool AllowAttributes) {
+    if (Req.IDs.empty() || !Index || Results.References.size() > Limit)
----------------
it might be nicer to make `IDs` a parameter too.


================
Comment at: clang-tools-extra/clangd/XRefs.cpp:1409
+      return;
     Results.HasMore |= Index->refs(Req, [&](const Ref &R) {
       // No need to continue process if we reach the limit.
----------------
just thinking out loud, i wonder why we don't just provide a symbolid in this callback too. the interface currently says refs will be returned in any order, and i am not sure about all the index implementations we have, but i think they should be able to provide that for each reference. that way we could get rid of multiple index queries (not that it matters too much currently, but it might one day..)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95451/new/

https://reviews.llvm.org/D95451



More information about the cfe-commits mailing list