aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/GlobalModuleIndex.cpp
diff options
context:
space:
mode:
authorVassil Vassilev <v.g.vassilev@gmail.com>2020-06-19 07:01:02 +0000
committerVassil Vassilev <v.g.vassilev@gmail.com>2020-06-22 08:03:11 +0000
commit46ea465b5b741fb0bf6e2cedd5cd6bf7026cd3c6 (patch)
tree84c99cd1f98f2d1dccefecf7b59a72277d06b7b1 /clang/lib/Serialization/GlobalModuleIndex.cpp
parent29b2c1ca72096ca06415b5e626e6728c42ef1e74 (diff)
downloadllvm-46ea465b5b741fb0bf6e2cedd5cd6bf7026cd3c6.zip
llvm-46ea465b5b741fb0bf6e2cedd5cd6bf7026cd3c6.tar.gz
llvm-46ea465b5b741fb0bf6e2cedd5cd6bf7026cd3c6.tar.bz2
Return false if the identifier is not in the global module index.
This allows clients to use the idiom: if (GlobalIndex->lookupIdentifier(Name, FoundModules)) { // work on the FoundModules } This is also a minor performance improvent for clang. Differential Revision: https://reviews.llvm.org/D81077
Diffstat (limited to 'clang/lib/Serialization/GlobalModuleIndex.cpp')
-rw-r--r--clang/lib/Serialization/GlobalModuleIndex.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp
index 958cca7..9192b3b 100644
--- a/clang/lib/Serialization/GlobalModuleIndex.cpp
+++ b/clang/lib/Serialization/GlobalModuleIndex.cpp
@@ -321,7 +321,7 @@ bool GlobalModuleIndex::lookupIdentifier(StringRef Name, HitSet &Hits) {
= *static_cast<IdentifierIndexTable *>(IdentifierIndex);
IdentifierIndexTable::iterator Known = Table.find(Name);
if (Known == Table.end()) {
- return true;
+ return false;
}
SmallVector<unsigned, 2> ModuleIDs = *Known;