ARM64: Range based for loop in ARM64PromoteConstant pass
authorJim Grosbach <grosbach@apple.com>
Mon, 7 Apr 2014 23:47:21 +0000 (23:47 +0000)
committerJim Grosbach <grosbach@apple.com>
Mon, 7 Apr 2014 23:47:21 +0000 (23:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205748 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM64/ARM64PromoteConstant.cpp

index 7a59006d850d9c98d541cdfcc614db219c9fa674..e5a75ae786b91b2b790394ada2b8f675a5a6fa84 100644 (file)
@@ -350,21 +350,19 @@ bool ARM64PromoteConstant::isDominated(Instruction *NewPt,
 
   // Traverse all the existing insertion point and check if one is dominating
   // NewPt
-  for (InsertionPoints::iterator IPI = InsertPts.begin(),
-                                 EndIPI = InsertPts.end();
-       IPI != EndIPI; ++IPI) {
-    if (NewPt == IPI->first || DT.dominates(IPI->first, NewPt) ||
-        // When IPI->first is a terminator instruction, DT may think that
+  for (auto &IPI : InsertPts) {
+    if (NewPt == IPI.first || DT.dominates(IPI.first, NewPt) ||
+        // When IPI.first is a terminator instruction, DT may think that
         // the result is defined on the edge.
         // Here we are testing the insertion point, not the definition.
-        (IPI->first->getParent() != NewPt->getParent() &&
-         DT.dominates(IPI->first->getParent(), NewPt->getParent()))) {
+        (IPI.first->getParent() != NewPt->getParent() &&
+         DT.dominates(IPI.first->getParent(), NewPt->getParent()))) {
       // No need to insert this point
       // Record the dominated use
       DEBUG(dbgs() << "Insertion point dominated by:\n");
-      DEBUG(IPI->first->print(dbgs()));
+      DEBUG(IPI.first->print(dbgs()));
       DEBUG(dbgs() << '\n');
-      IPI->second.push_back(UseIt);
+      IPI.second.push_back(UseIt);
       return true;
     }
   }