mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Reimplement removeDeadPasses().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32344 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0fb259046d
commit
f9a60ae75d
@ -522,7 +522,21 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
|
||||
|
||||
/// Remove analysis passes that are not used any longer
|
||||
void PMDataManager::removeDeadPasses(Pass *P) {
|
||||
// TODO : reimplement
|
||||
|
||||
std::vector<Pass *> DeadPasses;
|
||||
TPM->collectLastUses(DeadPasses, P);
|
||||
|
||||
for (std::vector<Pass *>::iterator I = DeadPasses.begin(),
|
||||
E = DeadPasses.end(); I != E; ++I) {
|
||||
(*I)->releaseMemory();
|
||||
|
||||
std::map<AnalysisID, Pass*>::iterator Pos =
|
||||
AvailableAnalysis.find((*I)->getPassInfo());
|
||||
|
||||
// It is possible that deadPass is already removed from the AvailableAnalysis
|
||||
if (Pos != AvailableAnalysis.end())
|
||||
AvailableAnalysis.erase(Pos);
|
||||
}
|
||||
}
|
||||
|
||||
/// Add pass P into the PassVector. Update
|
||||
|
Loading…
Reference in New Issue
Block a user