[llvm] [AsmParser] Use a range-based for loop (NFC) (PR #168488)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 18 07:39:29 PST 2025
================
@@ -315,11 +315,10 @@ bool LLParser::validateEndOfModule(bool UpgradeDebugInfo) {
return error(NT.second.second,
"use of undefined type '%" + Twine(NT.first) + "'");
- for (StringMap<std::pair<Type*, LocTy> >::iterator I =
- NamedTypes.begin(), E = NamedTypes.end(); I != E; ++I)
- if (I->second.second.isValid())
- return error(I->second.second,
- "use of undefined type named '" + I->getKey() + "'");
+ for (const auto &NamedType : NamedTypes)
+ if (NamedType.second.second.isValid())
+ return error(NamedType.second.second,
+ "use of undefined type named '" + NamedType.getKey() + "'");
----------------
kazutakahirata wrote:
I chose `TypeInfo` as the value type is more than a `Type` -- `std::pair<Type *, LocTy>`. Thanks!
https://github.com/llvm/llvm-project/pull/168488
More information about the llvm-commits
mailing list