[PM] Switch to a ranged based for loop. NFC
authorChandler Carruth <chandlerc@gmail.com>
Sun, 1 Feb 2015 10:40:21 +0000 (10:40 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 1 Feb 2015 10:40:21 +0000 (10:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227723 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/PassManager.h

index 2625768492645a41ccdafd588af85e765be4bf8b..a57a5020b8d4c27a075740770cb54338c94f4b6f 100644 (file)
@@ -782,8 +782,8 @@ public:
       FAM = &AM->getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
 
     PreservedAnalyses PA = PreservedAnalyses::all();
-    for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
-      PreservedAnalyses PassPA = Pass.run(*I, FAM);
+    for (Function &F : M) {
+      PreservedAnalyses PassPA = Pass.run(F, FAM);
 
       // We know that the function pass couldn't have invalidated any other
       // function's analyses (that's the contract of a function pass), so
@@ -791,7 +791,7 @@ public:
       // update our preserved set to reflect that these have already been
       // handled.
       if (FAM)
-        PassPA = FAM->invalidate(*I, std::move(PassPA));
+        PassPA = FAM->invalidate(F, std::move(PassPA));
 
       // Then intersect the preserved set so that invalidation of module
       // analyses will eventually occur when the module pass completes.