summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-11-21 09:08:47 -0800
committerGitHub <noreply@github.com>2025-11-21 09:08:47 -0800
commitf7e0432219b2c9de80d0ccd198748f563d2a71ea (patch)
tree2c6eaa7f1c24a01631f13fcc863f1d89d2dac350
parentb27749d8c7191f894e337a402344af7a9de9a5b0 (diff)
[LTO] Use a range-based for loop (NFC) (#169000)
Identified with modernize-loop-convert.
-rw-r--r--llvm/lib/LTO/LTOModule.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/LTO/LTOModule.cpp b/llvm/lib/LTO/LTOModule.cpp
index 7dd06118e2a5..9d5b0f54f7f2 100644
--- a/llvm/lib/LTO/LTOModule.cpp
+++ b/llvm/lib/LTO/LTOModule.cpp
@@ -620,13 +620,11 @@ void LTOModule::parseSymbols() {
}
// make symbols for all undefines
- for (StringMap<NameAndAttributes>::iterator u =_undefines.begin(),
- e = _undefines.end(); u != e; ++u) {
+ for (const auto &[Key, Value] : _undefines) {
// If this symbol also has a definition, then don't make an undefine because
// it is a tentative definition.
- if (_defines.count(u->getKey())) continue;
- NameAndAttributes info = u->getValue();
- _symbols.push_back(info);
+ if (!_defines.contains(Key))
+ _symbols.push_back(Value);
}
}