From 54bff8596fb1921bdb00ac6dd0bd1ac9e2420b58 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 30 Apr 2015 05:54:20 +0000 Subject: [PATCH] [TableGen] Used range-based for loop. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236205 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/TableGen/Record.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index c248370de17..58f2f07b0b0 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -1076,11 +1076,7 @@ static Init *ForeachHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type, std::vector NewOperands; std::vector NewList(MHSl->begin(), MHSl->end()); - for (std::vector::iterator li = NewList.begin(), - liend = NewList.end(); - li != liend; - ++li) { - Init *Item = *li; + for (Init *&Item : NewList) { NewOperands.clear(); for(int i = 0; i < RHSo->getNumOperands(); ++i) { // First, replace the foreach variable with the list item @@ -1095,7 +1091,7 @@ static Init *ForeachHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type, const OpInit *NewOp = RHSo->clone(NewOperands); Init *NewItem = NewOp->Fold(CurRec, CurMultiClass); if (NewItem != NewOp) - *li = NewItem; + Item = NewItem; } return ListInit::get(NewList, MHSl->getType()); } -- 2.34.1