aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/PassManager.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2006-11-11 01:31:05 +0000
committerDevang Patel <dpatel@apple.com>2006-11-11 01:31:05 +0000
commit85d344b0c68048527f1ac46ba22bbc950870d3c5 (patch)
tree8b20f5bfbbf860d1ef94732bb399bb9c9f7ef007 /lib/VMCore/PassManager.cpp
parent14d6581a7374bdb4a66ef6c30250efdc324f6dde (diff)
Move CommonPassManagerImpl from PassManager.h to PassManager.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31666 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/PassManager.cpp')
-rw-r--r--lib/VMCore/PassManager.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp
index 19154fe06e..1e52403399 100644
--- a/lib/VMCore/PassManager.cpp
+++ b/lib/VMCore/PassManager.cpp
@@ -14,11 +14,50 @@
#include "llvm/PassManager.h"
#include "llvm/Module.h"
+#include <vector>
+#include <set>
using namespace llvm;
namespace llvm {
+/// CommonPassManagerImpl helps pass manager analysis required by
+/// the managed passes. It provides methods to add/remove analysis
+/// available and query if certain analysis is available or not.
+class CommonPassManagerImpl : public Pass {
+
+public:
+
+ /// Return true IFF pass P's required analysis set does not required new
+ /// manager.
+ bool manageablePass(Pass *P);
+
+ /// Return true IFF AnalysisID AID is currently available.
+ bool analysisCurrentlyAvailable(AnalysisID AID);
+
+ /// Augment RequiredAnalysis by adding analysis required by pass P.
+ void noteDownRequiredAnalysis(Pass *P);
+
+ /// Augment AvailableAnalysis by adding analysis made available by pass P.
+ void noteDownAvailableAnalysis(Pass *P);
+
+ /// Remove AnalysisID from the RequiredSet
+ void removeAnalysis(AnalysisID AID);
+
+ /// Remove Analysis that is not preserved by the pass
+ void removeNotPreservedAnalysis(Pass *P);
+
+ /// Remove dead passes
+ void removeDeadPasses() { /* TODO : Implement */ }
+
+private:
+ // Analysis required by the passes managed by this manager
+ std::vector<AnalysisID> RequiredAnalysis;
+
+ // set of available Analysis
+ std::set<AnalysisID> AvailableAnalysis;
+};
+
/// BasicBlockPassManager_New manages BasicBlockPass. It batches all the
/// pass together and sequence them to process one basic block before
/// processing next basic block.