diff options
author | Chris Lattner <sabre@nondot.org> | 2002-09-29 22:50:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-09-29 22:50:22 +0000 |
commit | 3f00ef9660e486f01e99d01961e64a50b38138ca (patch) | |
tree | 2caa3b93be2161a77e711b3e3a345976d595d38a /lib | |
parent | b461373fbcdc5909cc7331fa64791cd039de4bc8 (diff) |
Fix a problem that was caused by stale analyses being in CurrentAnalyses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3981 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/PassManagerT.h | 13 |
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; } |