[clang-tools-extra] r344680 - [clangd] Fix buildbot failure.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 17 01:54:48 PDT 2018
Author: hokein
Date: Wed Oct 17 01:54:48 2018
New Revision: 344680
URL: http://llvm.org/viewvc/llvm-project?rev=344680&view=rev
Log:
[clangd] Fix buildbot failure.
Modified:
clang-tools-extra/trunk/clangd/index/SymbolCollector.cpp
Modified: clang-tools-extra/trunk/clangd/index/SymbolCollector.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/index/SymbolCollector.cpp?rev=344680&r1=344679&r2=344680&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/index/SymbolCollector.cpp (original)
+++ clang-tools-extra/trunk/clangd/index/SymbolCollector.cpp Wed Oct 17 01:54:48 2018
@@ -480,9 +480,6 @@ void SymbolCollector::finish() {
auto GetURI = [&](FileID FID) -> llvm::Optional<std::string> {
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;
More information about the cfe-commits
mailing list