Rangify for loops, NFC.

llvm-svn: 267889
This commit is contained in:
Yaron Keren 2016-04-28 14:49:44 +00:00
parent 567556aa9c
commit 8300995548
1 changed files with 14 additions and 22 deletions

View File

@ -531,9 +531,8 @@ PMTopLevelManager::setLastUser(ArrayRef<Pass*> AnalysisPasses, Pass *P) {
const AnalysisUsage::VectorType &IDs = AnUsage->getRequiredTransitiveSet(); const AnalysisUsage::VectorType &IDs = AnUsage->getRequiredTransitiveSet();
SmallVector<Pass *, 12> LastUses; SmallVector<Pass *, 12> LastUses;
SmallVector<Pass *, 12> LastPMUses; SmallVector<Pass *, 12> LastPMUses;
for (AnalysisUsage::VectorType::const_iterator I = IDs.begin(), for (AnalysisID ID : IDs) {
E = IDs.end(); I != E; ++I) { Pass *AnalysisPass = findAnalysisPass(ID);
Pass *AnalysisPass = findAnalysisPass(*I);
assert(AnalysisPass && "Expected analysis pass to exist."); assert(AnalysisPass && "Expected analysis pass to exist.");
AnalysisResolver *AR = AnalysisPass->getResolver(); AnalysisResolver *AR = AnalysisPass->getResolver();
assert(AR && "Expected analysis resolver to exist."); assert(AR && "Expected analysis resolver to exist.");
@ -791,29 +790,24 @@ void PMTopLevelManager::dumpArguments() const {
return; return;
dbgs() << "Pass Arguments: "; dbgs() << "Pass Arguments: ";
for (SmallVectorImpl<ImmutablePass *>::const_iterator I = for (ImmutablePass *P : ImmutablePasses)
ImmutablePasses.begin(), E = ImmutablePasses.end(); I != E; ++I) if (const PassInfo *PI = findAnalysisPassInfo(P->getPassID())) {
if (const PassInfo *PI = findAnalysisPassInfo((*I)->getPassID())) {
assert(PI && "Expected all immutable passes to be initialized"); assert(PI && "Expected all immutable passes to be initialized");
if (!PI->isAnalysisGroup()) if (!PI->isAnalysisGroup())
dbgs() << " -" << PI->getPassArgument(); dbgs() << " -" << PI->getPassArgument();
} }
for (SmallVectorImpl<PMDataManager *>::const_iterator I = for (PMDataManager *PM : PassManagers)
PassManagers.begin(), E = PassManagers.end(); I != E; ++I) PM->dumpPassArguments();
(*I)->dumpPassArguments();
dbgs() << "\n"; dbgs() << "\n";
} }
void PMTopLevelManager::initializeAllAnalysisInfo() { void PMTopLevelManager::initializeAllAnalysisInfo() {
for (SmallVectorImpl<PMDataManager *>::iterator I = PassManagers.begin(), for (PMDataManager *PM : PassManagers)
E = PassManagers.end(); I != E; ++I) PM->initializeAnalysisInfo();
(*I)->initializeAnalysisInfo();
// Initailize other pass managers // Initailize other pass managers
for (SmallVectorImpl<PMDataManager *>::iterator for (PMDataManager *IPM : IndirectPassManagers)
I = IndirectPassManagers.begin(), E = IndirectPassManagers.end(); IPM->initializeAnalysisInfo();
I != E; ++I)
(*I)->initializeAnalysisInfo();
for (DenseMap<Pass *, Pass *>::iterator DMI = LastUser.begin(), for (DenseMap<Pass *, Pass *>::iterator DMI = LastUser.begin(),
DME = LastUser.end(); DMI != DME; ++DMI) { DME = LastUser.end(); DMI != DME; ++DMI) {
@ -824,13 +818,11 @@ void PMTopLevelManager::initializeAllAnalysisInfo() {
/// Destructor /// Destructor
PMTopLevelManager::~PMTopLevelManager() { PMTopLevelManager::~PMTopLevelManager() {
for (SmallVectorImpl<PMDataManager *>::iterator I = PassManagers.begin(), for (PMDataManager *PM : PassManagers)
E = PassManagers.end(); I != E; ++I) delete PM;
delete *I;
for (SmallVectorImpl<ImmutablePass *>::iterator for (ImmutablePass *P : ImmutablePasses)
I = ImmutablePasses.begin(), E = ImmutablePasses.end(); I != E; ++I) delete P;
delete *I;
} }
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//