From ad04ba28103efdec91e341c11a4a238328564e2b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 27 Dec 2016 18:35:22 +0000 Subject: [PATCH] ASMParser: use range-based for loops (NFC) Convert the verify method to use a few more range based for loops, converting to const iterators in the process. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290617 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AsmParser/LLParser.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 8e86b483664..4cd986e143b 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -121,16 +121,13 @@ void LLParser::restoreParsingState(const SlotMapping *Slots) { /// module. bool LLParser::ValidateEndOfModule() { // Handle any function attribute group forward references. - for (std::map >::iterator - I = ForwardRefAttrGroups.begin(), E = ForwardRefAttrGroups.end(); - I != E; ++I) { - Value *V = I->first; - std::vector &Vec = I->second; + for (const auto &RAG : ForwardRefAttrGroups) { + Value *V = RAG.first; + const std::vector &Attrs = RAG.second; AttrBuilder B; - for (std::vector::iterator VI = Vec.begin(), VE = Vec.end(); - VI != VE; ++VI) - B.merge(NumberedAttrBuilders[*VI]); + for (const auto &Attr : Attrs) + B.merge(NumberedAttrBuilders[Attr]); if (Function *Fn = dyn_cast(V)) { AttributeSet AS = Fn->getAttributes(); -- 2.11.0