summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2018-10-17 08:54:48 +0000
committerHaojian Wu <hokein@google.com>2018-10-17 08:54:48 +0000
commitc014d863bee8bcef8fbb6bc98564bfd820e38b64 (patch)
tree0100ee55b39dc38311161177f5c83aed2aa5cb55
parent0404855529f2c2a10e7efb3f7adf1cf90c5cf182 (diff)
downloadbcm5719-llvm-c014d863bee8bcef8fbb6bc98564bfd820e38b64.tar.gz
bcm5719-llvm-c014d863bee8bcef8fbb6bc98564bfd820e38b64.zip
[clangd] Fix buildbot failure.
llvm-svn: 344680
-rw-r--r--clang-tools-extra/clangd/index/SymbolCollector.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang-tools-extra/clangd/index/SymbolCollector.cpp b/clang-tools-extra/clangd/index/SymbolCollector.cpp
index 73728df28eb..75f0eff7801 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<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;
OpenPOWER on IntegriCloud