diff options
author | Devang Patel <dpatel@apple.com> | 2006-12-08 22:47:25 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2006-12-08 22:47:25 +0000 |
commit | a083e94f7971ddafb817b1bcd86992d9fc4d8f9e (patch) | |
tree | fc4635c4b05e01d625255579dacf45732a35f945 /lib/VMCore/PassManager.cpp | |
parent | e61b7478e53cea3183d4aee3799a4f0977b850a0 (diff) |
Do not keep yet another list of pass managers in PassManagerImpl_New.
Use one provided by toplevel manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32380 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/PassManager.cpp')
-rw-r--r-- | lib/VMCore/PassManager.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index 1141c6a329..5c9da43b86 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -137,6 +137,10 @@ public: return ImmutablePasses; } + void addPassManager(Pass *Manager) { + PassManagers.push_back(Manager); + } + private: /// Collection of pass managers @@ -479,9 +483,6 @@ private: /// Add a pass into a passmanager queue. bool addPass(Pass *p); - // Collection of pass managers - std::vector<ModulePassManager_New *> PassManagers; - // Active Pass Manager ModulePassManager_New *activeManager; }; @@ -1018,7 +1019,7 @@ bool PassManagerImpl_New::addPass(Pass *P) { if (!activeManager || !activeManager->addPass(P)) { activeManager = new ModulePassManager_New(getDepth() + 1); - PassManagers.push_back(activeManager); + addPassManager(activeManager); return activeManager->addPass(P); } return true; @@ -1029,10 +1030,10 @@ bool PassManagerImpl_New::addPass(Pass *P) { bool PassManagerImpl_New::run(Module &M) { bool Changed = false; - for (std::vector<ModulePassManager_New *>::iterator itr = PassManagers.begin(), - e = PassManagers.end(); itr != e; ++itr) { - ModulePassManager_New *pm = *itr; - Changed |= pm->runOnModule(M); + for (std::vector<Pass *>::iterator I = passManagersBegin(), + E = passManagersEnd(); I != E; ++I) { + ModulePassManager_New *MP = dynamic_cast<ModulePassManager_New *>(*I); + Changed |= MP->runOnModule(M); } return Changed; } |