[PATCH] D116827: Don't pass uninitialized QueryKind

Kevin Athey via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 7 15:35:48 PST 2022


kda added inline comments.


================
Comment at: clang-tools-extra/clangd/XRefs.cpp:1313
   }
+  if (IDs.empty())
+    return {};
----------------
vitalybuka wrote:
> kda wrote:
> > It seems like the first line of 'findImplementors' is 'if (IDs.empty() || !Index)`.
> > I wonder if the correct fix is to drop the '!Index' check in findImplementors.
> Sorry, I am no following how "Index" is related to uninitialized QueryKind?
Oh.  Ignore some of my previous discussion, I missed the summary.

Why not just initialize QueryKind?
That seems like a more direct solution for the specific issue.
I believe it would be safe, as IDs is only inserted into when QueryKind is explicitly set.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116827



More information about the cfe-commits mailing list