[llvm] r239155 - Rangify for loops in LegacyPassManager.cpp.
Yaron Keren
yaron.keren at gmail.com
Fri Jun 5 07:15:08 PDT 2015
Author: yrnkrn
Date: Fri Jun 5 09:15:07 2015
New Revision: 239155
URL: http://llvm.org/viewvc/llvm-project?rev=239155&view=rev
Log:
Rangify for loops in LegacyPassManager.cpp.
Modified:
llvm/trunk/lib/IR/LegacyPassManager.cpp
Modified: llvm/trunk/lib/IR/LegacyPassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LegacyPassManager.cpp?rev=239155&r1=239154&r2=239155&view=diff
==============================================================================
--- llvm/trunk/lib/IR/LegacyPassManager.cpp (original)
+++ llvm/trunk/lib/IR/LegacyPassManager.cpp Fri Jun 5 09:15:07 2015
@@ -1553,8 +1553,8 @@ bool FPPassManager::runOnFunction(Functi
bool FPPassManager::runOnModule(Module &M) {
bool Changed = false;
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- Changed |= runOnFunction(*I);
+ for (Function &F : M)
+ Changed |= runOnFunction(F);
return Changed;
}
@@ -1588,10 +1588,8 @@ MPPassManager::runOnModule(Module &M) {
bool Changed = false;
// Initialize on-the-fly passes
- for (std::map<Pass *, FunctionPassManagerImpl *>::iterator
- I = OnTheFlyManagers.begin(), E = OnTheFlyManagers.end();
- I != E; ++I) {
- FunctionPassManagerImpl *FPP = I->second;
+ for (auto &OnTheFlyManager : OnTheFlyManagers) {
+ FunctionPassManagerImpl *FPP = OnTheFlyManager.second;
Changed |= FPP->doInitialization(M);
}
@@ -1632,10 +1630,8 @@ MPPassManager::runOnModule(Module &M) {
Changed |= getContainedPass(Index)->doFinalization(M);
// Finalize on-the-fly passes
- for (std::map<Pass *, FunctionPassManagerImpl *>::iterator
- I = OnTheFlyManagers.begin(), E = OnTheFlyManagers.end();
- I != E; ++I) {
- FunctionPassManagerImpl *FPP = I->second;
+ for (auto &OnTheFlyManager : OnTheFlyManagers) {
+ FunctionPassManagerImpl *FPP = OnTheFlyManager.second;
// We don't know when is the last time an on-the-fly pass is run,
// so we need to releaseMemory / finalize here
FPP->releaseMemoryOnTheFly();
@@ -1711,11 +1707,8 @@ bool PassManagerImpl::run(Module &M) {
dumpArguments();
dumpPasses();
- SmallVectorImpl<ImmutablePass *>& IPV = getImmutablePasses();
- for (SmallVectorImpl<ImmutablePass *>::const_iterator I = IPV.begin(),
- E = IPV.end(); I != E; ++I) {
- Changed |= (*I)->doInitialization(M);
- }
+ for (ImmutablePass *ImPass : getImmutablePasses())
+ Changed |= ImPass->doInitialization(M);
initializeAllAnalysisInfo();
for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index) {
@@ -1723,10 +1716,8 @@ bool PassManagerImpl::run(Module &M) {
M.getContext().yield();
}
- for (SmallVectorImpl<ImmutablePass *>::const_iterator I = IPV.begin(),
- E = IPV.end(); I != E; ++I) {
- Changed |= (*I)->doFinalization(M);
- }
+ for (ImmutablePass *ImPass : getImmutablePasses())
+ Changed |= ImPass->doFinalization(M);
return Changed;
}
More information about the llvm-commits
mailing list