r248100 - Convert two loops to range-based loops. No behavior change.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 19 14:36:52 PDT 2015


Author: nico
Date: Sat Sep 19 16:36:51 2015
New Revision: 248100

URL: http://llvm.org/viewvc/llvm-project?rev=248100&view=rev
Log:
Convert two loops to range-based loops. No behavior change.

Modified:
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=248100&r1=248099&r2=248100&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Sat Sep 19 16:36:51 2015
@@ -951,8 +951,8 @@ static bool ContainsCompileOrAssembleAct
       isa<AssembleJobAction>(A))
     return true;
 
-  for (Action::const_iterator it = A->begin(), ie = A->end(); it != ie; ++it)
-    if (ContainsCompileOrAssembleAction(*it))
+  for (const Action *Input : *A)
+    if (ContainsCompileOrAssembleAction(Input))
       return true;
 
   return false;
@@ -993,9 +993,7 @@ void Driver::BuildUniversalActions(const
 
   // Add in arch bindings for every top level action, as well as lipo and
   // dsymutil steps if needed.
-  for (unsigned i = 0, e = SingleActions.size(); i != e; ++i) {
-    Action *Act = SingleActions[i];
-
+  for (Action* Act : SingleActions) {
     // Make sure we can lipo this kind of output. If not (and it is an actual
     // output) then we disallow, since we can't create an output file with the
     // right name without overwriting it. We could remove this oddity by just




More information about the cfe-commits mailing list