mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-08 03:30:22 +00:00
doInitialization and doFinalization for BasicBlockPassManager_New
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32345 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f9a60ae75d
commit
964e45e607
@ -199,7 +199,6 @@ void PMTopLevelManager::schedulePass(Pass *P, Pass *PM) {
|
|||||||
addTopLevelPass(P);
|
addTopLevelPass(P);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// PMDataManager
|
// PMDataManager
|
||||||
|
|
||||||
@ -327,7 +326,11 @@ public:
|
|||||||
Info.setPreservesAll();
|
Info.setPreservesAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
bool doInitialization(Module &M);
|
||||||
|
bool doInitialization(Function &F);
|
||||||
|
bool doFinalization(Module &M);
|
||||||
|
bool doFinalization(Function &F);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// FunctionPassManagerImpl_New manages FunctionPasses and BasicBlockPassManagers.
|
/// FunctionPassManagerImpl_New manages FunctionPasses and BasicBlockPassManagers.
|
||||||
@ -533,7 +536,7 @@ void PMDataManager::removeDeadPasses(Pass *P) {
|
|||||||
std::map<AnalysisID, Pass*>::iterator Pos =
|
std::map<AnalysisID, Pass*>::iterator Pos =
|
||||||
AvailableAnalysis.find((*I)->getPassInfo());
|
AvailableAnalysis.find((*I)->getPassInfo());
|
||||||
|
|
||||||
// It is possible that deadPass is already removed from the AvailableAnalysis
|
// It is possible that pass is already removed from the AvailableAnalysis
|
||||||
if (Pos != AvailableAnalysis.end())
|
if (Pos != AvailableAnalysis.end())
|
||||||
AvailableAnalysis.erase(Pos);
|
AvailableAnalysis.erase(Pos);
|
||||||
}
|
}
|
||||||
@ -669,6 +672,60 @@ Pass * BasicBlockPassManager_New::getAnalysisPassFromManager(AnalysisID AID) {
|
|||||||
return getAnalysisPass(AID);
|
return getAnalysisPass(AID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Implement doInitialization and doFinalization
|
||||||
|
inline bool BasicBlockPassManager_New::doInitialization(Module &M) {
|
||||||
|
bool Changed = false;
|
||||||
|
|
||||||
|
for (std::vector<Pass *>::iterator itr = passVectorBegin(),
|
||||||
|
e = passVectorEnd(); itr != e; ++itr) {
|
||||||
|
Pass *P = *itr;
|
||||||
|
BasicBlockPass *BP = dynamic_cast<BasicBlockPass*>(P);
|
||||||
|
Changed |= BP->doInitialization(M);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool BasicBlockPassManager_New::doFinalization(Module &M) {
|
||||||
|
bool Changed = false;
|
||||||
|
|
||||||
|
for (std::vector<Pass *>::iterator itr = passVectorBegin(),
|
||||||
|
e = passVectorEnd(); itr != e; ++itr) {
|
||||||
|
Pass *P = *itr;
|
||||||
|
BasicBlockPass *BP = dynamic_cast<BasicBlockPass*>(P);
|
||||||
|
Changed |= BP->doFinalization(M);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool BasicBlockPassManager_New::doInitialization(Function &F) {
|
||||||
|
bool Changed = false;
|
||||||
|
|
||||||
|
for (std::vector<Pass *>::iterator itr = passVectorBegin(),
|
||||||
|
e = passVectorEnd(); itr != e; ++itr) {
|
||||||
|
Pass *P = *itr;
|
||||||
|
BasicBlockPass *BP = dynamic_cast<BasicBlockPass*>(P);
|
||||||
|
Changed |= BP->doInitialization(F);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool BasicBlockPassManager_New::doFinalization(Function &F) {
|
||||||
|
bool Changed = false;
|
||||||
|
|
||||||
|
for (std::vector<Pass *>::iterator itr = passVectorBegin(),
|
||||||
|
e = passVectorEnd(); itr != e; ++itr) {
|
||||||
|
Pass *P = *itr;
|
||||||
|
BasicBlockPass *BP = dynamic_cast<BasicBlockPass*>(P);
|
||||||
|
Changed |= BP->doFinalization(F);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// FunctionPassManager_New implementation
|
// FunctionPassManager_New implementation
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user