diff options
| author | Devang Patel <dpatel@apple.com> | 2006-11-07 22:56:50 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2006-11-07 22:56:50 +0000 |
| commit | 3c8eb62560a776830cfd0e332504ccb9e333ed79 (patch) | |
| tree | 1fe02c6cec27a20490417ec606b433d3083edf6f | |
| parent | cc85563dd9403854532775f9f71ba9e1463c6194 (diff) | |
| download | bcm5719-llvm-3c8eb62560a776830cfd0e332504ccb9e333ed79.tar.gz bcm5719-llvm-3c8eb62560a776830cfd0e332504ccb9e333ed79.zip | |
Update new pass managers to use PassManagerAnalysisHelper API.
llvm-svn: 31526
| -rw-r--r-- | llvm/lib/VMCore/PassManager.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/llvm/lib/VMCore/PassManager.cpp b/llvm/lib/VMCore/PassManager.cpp index 766f8ce8b46..de6ce20a1e9 100644 --- a/llvm/lib/VMCore/PassManager.cpp +++ b/llvm/lib/VMCore/PassManager.cpp @@ -69,8 +69,13 @@ BasicBlockPassManager_New::addPass (Pass *P) { if (!BP) return false; - // TODO: Check if it suitable to manage P using this BasicBlockPassManager - // or we need another instance of BasicBlockPassManager + // If this pass does not preserve anlysis that is used by other passes + // managed by this manager than it is not a suiable pass for this manager. + if (!manageablePass (P)) + return false; + + // Take a note of analysis required by this pass. + noteDownRequiredAnalysis(P); // Add pass PassVector.push_back(BP); @@ -124,8 +129,13 @@ FunctionPassManager_New::addPass (Pass *P) { if (!FP) return false; - // TODO: Check if it suitable to manage P using this FunctionPassManager - // or we need another instance of FunctionPassManager + // If this pass does not preserve anlysis that is used by other passes + // managed by this manager than it is not a suiable pass for this manager. + if (!manageablePass (P)) + return false; + + // Take a note of analysis required by this pass. + noteDownRequiredAnalysis(P); PassVector.push_back(FP); activeBBPassManager = NULL; @@ -179,8 +189,13 @@ ModulePassManager_New::addPass (Pass *P) { if (!MP) return false; - // TODO: Check if it suitable to manage P using this ModulePassManager - // or we need another instance of ModulePassManager + // If this pass does not preserve anlysis that is used by other passes + // managed by this manager than it is not a suiable pass for this manager. + if (!manageablePass (P)) + return false; + + // Take a note of analysis required by this pass. + noteDownRequiredAnalysis(P); PassVector.push_back(MP); activeFunctionPassManager = NULL; |

