[PATCH] D101750: [clangd] Find implementors only when index is present.

Utkarsh Saxena via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 3 04:08:01 PDT 2021


usaxena95 created this revision.
usaxena95 added a reviewer: sammccall.
Herald added subscribers: kadircet, arphaman.
usaxena95 requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101750

Files:
  clang-tools-extra/clangd/XRefs.cpp


Index: clang-tools-extra/clangd/XRefs.cpp
===================================================================
--- clang-tools-extra/clangd/XRefs.cpp
+++ clang-tools-extra/clangd/XRefs.cpp
@@ -299,7 +299,7 @@
                                             RelationKind Predicate,
                                             const SymbolIndex *Index,
                                             llvm::StringRef MainFilePath) {
-  if (IDs.empty())
+  if (IDs.empty() || !Index)
     return {};
   static constexpr trace::Metric FindImplementorsMetric(
       "find_implementors", trace::Metric::Counter, "case");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101750.342351.patch
Type: text/x-patch
Size: 610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210503/de8dc728/attachment.bin>


More information about the cfe-commits mailing list