mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-30 00:24:00 +00:00
Reimplement removeDeadPasses().
llvm-svn: 32344
This commit is contained in:
parent
0b4830a079
commit
67bb3725d4
@ -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…
x
Reference in New Issue
Block a user