diff options
author | Dan Gohman <gohman@apple.com> | 2010-08-16 21:38:42 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-08-16 21:38:42 +0000 |
commit | e85c619980c09c420cae3ebd20d91febff3f381d (patch) | |
tree | 86b30c383cdca486baafe3093f6894b26cc319c9 /llvm/lib/VMCore/PassManager.cpp | |
parent | 6ca006c7c13da67cd3aa19c2067e6990ac97c8d8 (diff) | |
download | bcm5719-llvm-e85c619980c09c420cae3ebd20d91febff3f381d.tar.gz bcm5719-llvm-e85c619980c09c420cae3ebd20d91febff3f381d.zip |
Eliminate the TopLevelManagerType enum; instead, just make
PMTopLevelManager's constructor take a PMDataManager *, which already
provides the needed abstraction support.
llvm-svn: 111189
Diffstat (limited to 'llvm/lib/VMCore/PassManager.cpp')
-rw-r--r-- | llvm/lib/VMCore/PassManager.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/llvm/lib/VMCore/PassManager.cpp b/llvm/lib/VMCore/PassManager.cpp index 547036a7818..df96190b43b 100644 --- a/llvm/lib/VMCore/PassManager.cpp +++ b/llvm/lib/VMCore/PassManager.cpp @@ -226,7 +226,7 @@ public: static char ID; explicit FunctionPassManagerImpl(int Depth) : Pass(PT_PassManager, ID), PMDataManager(Depth), - PMTopLevelManager(TLM_Function), wasRun(false) { } + PMTopLevelManager(new FPPassManager(1)), wasRun(false) {} /// add - Add a pass to the queue of passes to run. This passes ownership of /// the Pass to the PassManager. When the PassManager is destroyed, the pass @@ -386,7 +386,7 @@ public: static char ID; explicit PassManagerImpl(int Depth) : Pass(PT_PassManager, ID), PMDataManager(Depth), - PMTopLevelManager(TLM_Pass) { } + PMTopLevelManager(new MPPassManager(1)) {} /// add - Add a pass to the queue of passes to run. This passes ownership of /// the Pass to the PassManager. When the PassManager is destroyed, the pass @@ -490,18 +490,10 @@ static TimingInfo *TheTimeInfo; // PMTopLevelManager implementation /// Initialize top level manager. Create first pass manager. -PMTopLevelManager::PMTopLevelManager(enum TopLevelManagerType t) { - if (t == TLM_Pass) { - MPPassManager *MPP = new MPPassManager(1); - MPP->setTopLevelManager(this); - addPassManager(MPP); - activeStack.push(MPP); - } else if (t == TLM_Function) { - FPPassManager *FPP = new FPPassManager(1); - FPP->setTopLevelManager(this); - addPassManager(FPP); - activeStack.push(FPP); - } +PMTopLevelManager::PMTopLevelManager(PMDataManager *PMDM) { + PMDM->setTopLevelManager(this); + addPassManager(PMDM); + activeStack.push(PMDM); } /// Set pass P as the last user of the given analysis passes. |