[llvm] f7e0432 - [LTO] Use a range-based for loop (NFC) (#169000)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 21 09:08:52 PST 2025
Author: Kazu Hirata
Date: 2025-11-21T09:08:47-08:00
New Revision: f7e0432219b2c9de80d0ccd198748f563d2a71ea
URL: https://github.com/llvm/llvm-project/commit/f7e0432219b2c9de80d0ccd198748f563d2a71ea
DIFF: https://github.com/llvm/llvm-project/commit/f7e0432219b2c9de80d0ccd198748f563d2a71ea.diff
LOG: [LTO] Use a range-based for loop (NFC) (#169000)
Identified with modernize-loop-convert.
Added:
Modified:
llvm/lib/LTO/LTOModule.cpp
Removed:
################################################################################
diff --git a/llvm/lib/LTO/LTOModule.cpp b/llvm/lib/LTO/LTOModule.cpp
index 7dd06118e2a57..9d5b0f54f7f21 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);
}
}
More information about the llvm-commits
mailing list