From 9973aeede514345cdb8c03d0c0bb317b9bc740c6 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 1 Feb 2015 10:40:21 +0000 Subject: [PATCH] [PM] Switch to a ranged based for loop. NFC llvm-svn: 227723 --- llvm/include/llvm/IR/PassManager.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h index 2625768..a57a502 100644 --- a/llvm/include/llvm/IR/PassManager.h +++ b/llvm/include/llvm/IR/PassManager.h @@ -782,8 +782,8 @@ public: FAM = &AM->getResult(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. -- 2.7.4