From: Haojian Wu Date: Wed, 17 Oct 2018 08:54:48 +0000 (+0000) Subject: [clangd] Fix buildbot failure. X-Git-Tag: llvmorg-8.0.0-rc1~6366 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c014d863bee8bcef8fbb6bc98564bfd820e38b64;p=platform%2Fupstream%2Fllvm.git [clangd] Fix buildbot failure. llvm-svn: 344680 --- 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;