Make LoopPass::getContainedPass return a LoopPass* instead of a Pass*

and remove casts from all its callers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110848 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-08-11 20:34:43 +00:00
parent fa5c2a67c3
commit bd4d66d56a
2 changed files with 8 additions and 8 deletions

View File

@ -104,10 +104,10 @@ public:
/// Print passes managed by this manager
void dumpPassStructure(unsigned Offset);
Pass *getContainedPass(unsigned N) {
LoopPass *getContainedPass(unsigned N) {
assert(N < PassVector.size() && "Pass number out of range!");
Pass *FP = static_cast<Pass *>(PassVector[N]);
return FP;
LoopPass *LP = static_cast<LoopPass *>(PassVector[N]);
return LP;
}
virtual PassManagerType getPassManagerType() const {

View File

@ -183,7 +183,7 @@ void LPPassManager::redoLoop(Loop *L) {
void LPPassManager::cloneBasicBlockSimpleAnalysis(BasicBlock *From,
BasicBlock *To, Loop *L) {
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
LoopPass *LP = (LoopPass *)getContainedPass(Index);
LoopPass *LP = getContainedPass(Index);
LP->cloneBasicBlockAnalysis(From, To, L);
}
}
@ -198,7 +198,7 @@ void LPPassManager::deleteSimpleAnalysisValue(Value *V, Loop *L) {
}
}
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
LoopPass *LP = (LoopPass *)getContainedPass(Index);
LoopPass *LP = getContainedPass(Index);
LP->deleteAnalysisValue(V, L);
}
}
@ -240,7 +240,7 @@ bool LPPassManager::runOnFunction(Function &F) {
I != E; ++I) {
Loop *L = *I;
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
LoopPass *P = (LoopPass*)getContainedPass(Index);
LoopPass *P = getContainedPass(Index);
Changed |= P->doInitialization(L, *this);
}
}
@ -254,7 +254,7 @@ bool LPPassManager::runOnFunction(Function &F) {
// Run all passes on the current Loop.
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
LoopPass *P = (LoopPass*)getContainedPass(Index);
LoopPass *P = getContainedPass(Index);
dumpPassInfo(P, EXECUTION_MSG, ON_LOOP_MSG,
CurrentLoop->getHeader()->getName());
@ -320,7 +320,7 @@ bool LPPassManager::runOnFunction(Function &F) {
// Finalization
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
LoopPass *P = (LoopPass *)getContainedPass(Index);
LoopPass *P = getContainedPass(Index);
Changed |= P->doFinalization();
}