r239140 - C++ 11 rangify for loop.

Yaron Keren yaron.keren at gmail.com
Fri Jun 5 02:40:54 PDT 2015


Author: yrnkrn
Date: Fri Jun  5 04:40:53 2015
New Revision: 239140

URL: http://llvm.org/viewvc/llvm-project?rev=239140&view=rev
Log:
C++ 11 rangify for loop.


Modified:
    cfe/trunk/lib/CodeGen/BackendUtil.cpp

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=239140&r1=239139&r2=239140&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Fri Jun  5 04:40:53 2015
@@ -622,10 +622,9 @@ void EmitAssemblyHelper::EmitAssembly(Ba
     PrettyStackTraceString CrashInfo("Per-function optimization");
 
     PerFunctionPasses->doInitialization();
-    for (Module::iterator I = TheModule->begin(),
-           E = TheModule->end(); I != E; ++I)
-      if (!I->isDeclaration())
-        PerFunctionPasses->run(*I);
+    for (Function &F : *TheModule)
+      if (!F.isDeclaration())
+        PerFunctionPasses->run(F);
     PerFunctionPasses->doFinalization();
   }
 





More information about the cfe-commits mailing list