[clang] c7895f0 - [DependencyScanning] Avoid repeated hash lookups (NFC) (#111088)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 4 07:37:58 PDT 2024
Author: Kazu Hirata
Date: 2024-10-04T07:37:54-07:00
New Revision: c7895f0d72ef3797fff6f687fd696e9a70911703
URL: https://github.com/llvm/llvm-project/commit/c7895f0d72ef3797fff6f687fd696e9a70911703
DIFF: https://github.com/llvm/llvm-project/commit/c7895f0d72ef3797fff6f687fd696e9a70911703.diff
LOG: [DependencyScanning] Avoid repeated hash lookups (NFC) (#111088)
Added:
Modified:
clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
Removed:
################################################################################
diff --git a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
index 677f426590ab9e..77f9d07175c2c1 100644
--- a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
+++ b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
@@ -549,7 +549,7 @@ void ModuleDepCollectorPP::EndOfMainFile() {
auto It = MDC.ModularDeps.find(M);
// Only report direct dependencies that were successfully handled.
if (It != MDC.ModularDeps.end())
- MDC.Consumer.handleDirectModuleDependency(MDC.ModularDeps[M]->ID);
+ MDC.Consumer.handleDirectModuleDependency(It->second->ID);
}
for (auto &&I : MDC.FileDeps)
More information about the cfe-commits
mailing list