aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/PassManagerT.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/VMCore/PassManagerT.h b/lib/VMCore/PassManagerT.h
index 913a64f89e..cf8624105d 100644
--- a/lib/VMCore/PassManagerT.h
+++ b/lib/VMCore/PassManagerT.h
@@ -292,6 +292,19 @@ public:
(Annotable*)M);
(*I)->releaseMemory();
}
+
+ // Make sure to remove dead passes from the CurrentAnalyses list...
+ for (std::map<AnalysisID, Pass*>::iterator I = CurrentAnalyses.begin();
+ I != CurrentAnalyses.end(); ) {
+ std::vector<Pass*>::iterator DPI = std::find(DeadPass.begin(),
+ DeadPass.end(), I->second);
+ if (DPI != DeadPass.end()) { // This pass is dead now... remove it
+ std::map<AnalysisID, Pass*>::iterator IDead = I++;
+ CurrentAnalyses.erase(IDead);
+ } else {
+ ++I; // Move on to the next element...
+ }
+ }
}
return MadeChanges;
}