From 46ea465b5b741fb0bf6e2cedd5cd6bf7026cd3c6 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 19 Jun 2020 07:01:02 +0000 Subject: [PATCH] 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 --- clang/lib/Serialization/GlobalModuleIndex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp index 958cca734572..9192b3b476bb 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(IdentifierIndex); IdentifierIndexTable::iterator Known = Table.find(Name); if (Known == Table.end()) { - return true; + return false; } SmallVector ModuleIDs = *Known;