Rangify for loops in LegacyPassManager.cpp.

llvm-svn: 239155
This commit is contained in:
Yaron Keren 2015-06-05 14:15:07 +00:00
parent 09677ad882
commit 3b1e24be56
1 changed files with 10 additions and 19 deletions

View File

@ -1553,8 +1553,8 @@ bool FPPassManager::runOnFunction(Function &F) {
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;
}