[llvm] r236205 - [TableGen] Used range-based for loop. NFC.

Sean Silva chisophugis at gmail.com
Thu Apr 30 14:29:27 PDT 2015


Thanks for all these TableGen cleanups!

On Wed, Apr 29, 2015 at 10:54 PM, Craig Topper <craig.topper at gmail.com>
wrote:

> Author: ctopper
> Date: Thu Apr 30 00:54:20 2015
> New Revision: 236205
>
> URL: http://llvm.org/viewvc/llvm-project?rev=236205&view=rev
> Log:
> [TableGen] Used range-based for loop. NFC.
>
> Modified:
>     llvm/trunk/lib/TableGen/Record.cpp
>
> Modified: llvm/trunk/lib/TableGen/Record.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=236205&r1=236204&r2=236205&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/TableGen/Record.cpp (original)
> +++ llvm/trunk/lib/TableGen/Record.cpp Thu Apr 30 00:54:20 2015
> @@ -1076,11 +1076,7 @@ static Init *ForeachHelper(Init *LHS, In
>        std::vector<Init *> NewOperands;
>        std::vector<Init *> NewList(MHSl->begin(), MHSl->end());
>
> -      for (std::vector<Init *>::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, In
>          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());
>      }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150430/151e1536/attachment.html>


More information about the llvm-commits mailing list