diff options
author | Devang Patel <dpatel@apple.com> | 2006-12-12 23:07:44 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2006-12-12 23:07:44 +0000 |
commit | 54e247d2d0c07544b3e638e80b816f352ec152c1 (patch) | |
tree | c780e2544c6b772eb8eced0289c488d6fd881f7b /lib/VMCore/PassManager.cpp | |
parent | 395ed739849a0507a2faae0829287c039c3589f8 (diff) |
removeNotPreservedAnalysis().
Do not remove ImmutablePass from the list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32507 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/PassManager.cpp')
-rw-r--r-- | lib/VMCore/PassManager.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index 867d9ae5fa..1f1890c31f 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -580,13 +580,17 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) { const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet(); for (std::map<AnalysisID, Pass*>::iterator I = AvailableAnalysis.begin(), - E = AvailableAnalysis.end(); I != E; ++I ) { + E = AvailableAnalysis.end(); I != E; ) { if (std::find(PreservedSet.begin(), PreservedSet.end(), I->first) == PreservedSet.end()) { // Remove this analysis - std::map<AnalysisID, Pass*>::iterator J = I++; - AvailableAnalysis.erase(J); - } + if (!dynamic_cast<ImmutablePass*>(I->second)) { + std::map<AnalysisID, Pass*>::iterator J = I++; + AvailableAnalysis.erase(J); + } else + ++I; + } else + ++I; } } |