From: Sanjay Patel <spatel@rotateright.com>
Date: Tue, 19 May 2015 17:49:14 +0000 (+0000)
Subject: use range-based for loop
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=038aeda7cfa647a33cbf17ec4c72b4d1a5b2d42e;p=llvm

use range-based for loop


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237705 91177308-0d34-0410-b5e6-96231b3b80d8
---

diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index e8d168d7188..8d5bd2b3389 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -8294,11 +8294,11 @@ SDValue DAGCombiner::visitFDIV(SDNode *N) {
       SDValue Reciprocal = DAG.getNode(ISD::FDIV, DL, VT, FPOne, N1);
 
       // Dividend / Divisor -> Dividend * Reciprocal
-      for (auto I = Users.begin(), E = Users.end(); I != E; ++I) {
-        if ((*I)->getOperand(0) != FPOne) {
-          SDValue NewNode = DAG.getNode(ISD::FMUL, SDLoc(*I), VT,
-                                        (*I)->getOperand(0), Reciprocal);
-          DAG.ReplaceAllUsesWith(*I, NewNode.getNode());
+      for (auto &U : Users) {
+        if (U->getOperand(0) != FPOne) {
+          SDValue NewNode = DAG.getNode(ISD::FMUL, SDLoc(U), VT,
+                                        U->getOperand(0), Reciprocal);
+          DAG.ReplaceAllUsesWith(U, NewNode.getNode());
         }
       }
       return SDValue();