[clang-tools-extra] c3d5f30 - [clangd] Find implementors only when index is present.

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Mon May 3 08:16:45 PDT 2021


Author: Utkarsh Saxena
Date: 2021-05-03T17:16:33+02:00
New Revision: c3d5f306e910788fcc4db8da9c9e819a0869264b

URL: https://github.com/llvm/llvm-project/commit/c3d5f306e910788fcc4db8da9c9e819a0869264b
DIFF: https://github.com/llvm/llvm-project/commit/c3d5f306e910788fcc4db8da9c9e819a0869264b.diff

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

Differential Revision: https://reviews.llvm.org/D101750

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp
index bb51b4a48d09..c21d3c3074ce 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -299,7 +299,7 @@ std::vector<LocatedSymbol> findImplementors(llvm::DenseSet<SymbolID> IDs,
                                             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");


        


More information about the cfe-commits mailing list