<div dir="ltr">Thanks for all these TableGen cleanups!</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 29, 2015 at 10:54 PM, Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ctopper<br>
Date: Thu Apr 30 00:54:20 2015<br>
New Revision: 236205<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=236205&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=236205&view=rev</a><br>
Log:<br>
[TableGen] Used range-based for loop. NFC.<br>
<br>
Modified:<br>
    llvm/trunk/lib/TableGen/Record.cpp<br>
<br>
Modified: llvm/trunk/lib/TableGen/Record.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=236205&r1=236204&r2=236205&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=236205&r1=236204&r2=236205&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/TableGen/Record.cpp (original)<br>
+++ llvm/trunk/lib/TableGen/Record.cpp Thu Apr 30 00:54:20 2015<br>
@@ -1076,11 +1076,7 @@ static Init *ForeachHelper(Init *LHS, In<br>
       std::vector<Init *> NewOperands;<br>
       std::vector<Init *> NewList(MHSl->begin(), MHSl->end());<br>
<br>
-      for (std::vector<Init *>::iterator li = NewList.begin(),<br>
-             liend = NewList.end();<br>
-           li != liend;<br>
-           ++li) {<br>
-        Init *Item = *li;<br>
+      for (Init *&Item : NewList) {<br>
         NewOperands.clear();<br>
         for(int i = 0; i < RHSo->getNumOperands(); ++i) {<br>
           // First, replace the foreach variable with the list item<br>
@@ -1095,7 +1091,7 @@ static Init *ForeachHelper(Init *LHS, In<br>
         const OpInit *NewOp = RHSo->clone(NewOperands);<br>
         Init *NewItem = NewOp->Fold(CurRec, CurMultiClass);<br>
         if (NewItem != NewOp)<br>
-          *li = NewItem;<br>
+          Item = NewItem;<br>
       }<br>
       return ListInit::get(NewList, MHSl->getType());<br>
     }<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>