From c014d863bee8bcef8fbb6bc98564bfd820e38b64 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 17 Oct 2018 08:54:48 +0000 Subject: [PATCH] [clangd] Fix buildbot failure. llvm-svn: 344680 --- clang-tools-extra/clangd/index/SymbolCollector.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clang-tools-extra/clangd/index/SymbolCollector.cpp b/clang-tools-extra/clangd/index/SymbolCollector.cpp index 73728df..75f0eff 100644 --- a/clang-tools-extra/clangd/index/SymbolCollector.cpp +++ b/clang-tools-extra/clangd/index/SymbolCollector.cpp @@ -480,9 +480,6 @@ void SymbolCollector::finish() { auto GetURI = [&](FileID FID) -> llvm::Optional { auto Found = URICache.find(FID); if (Found == URICache.end()) { - // Ignore cases where we can not find a corresponding file entry - // for the loc, thoses are not interesting, e.g. symbols formed - // via macro concatenation. if (auto *FileEntry = SM.getFileEntryForID(FID)) { auto FileURI = toURI(SM, FileEntry->getName(), Opts); if (!FileURI) { @@ -490,6 +487,11 @@ void SymbolCollector::finish() { FileURI = ""; // reset to empty as we also want to cache this case. } Found = URICache.insert({FID, *FileURI}).first; + } else { + // Ignore cases where we can not find a corresponding file entry + // for the loc, thoses are not interesting, e.g. symbols formed + // via macro concatenation. + return llvm::None; } } return Found->second; -- 2.7.4