From: Saleem Abdulrasool Date: Tue, 27 Dec 2016 18:35:22 +0000 (+0000) Subject: ASMParser: use range-based for loops (NFC) X-Git-Tag: android-x86-7.1-r4~22704 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ad04ba28103efdec91e341c11a4a238328564e2b;p=android-x86%2Fexternal-llvm.git 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 --- 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();