[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Devang Patel
dpatel at apple.com
Thu Dec 7 15:25:13 PST 2006
Changes in directory llvm/lib/VMCore:
PassManager.cpp updated: 1.55 -> 1.56
---
Log message:
Maintain level(or depth) of pass manager in pass manager food chain.
---
Diffs of the changes: (+21 -10)
PassManager.cpp | 31 +++++++++++++++++++++----------
1 files changed, 21 insertions(+), 10 deletions(-)
Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.55 llvm/lib/VMCore/PassManager.cpp:1.56
--- llvm/lib/VMCore/PassManager.cpp:1.55 Thu Dec 7 17:05:44 2006
+++ llvm/lib/VMCore/PassManager.cpp Thu Dec 7 17:24:58 2006
@@ -209,7 +209,7 @@
public:
- PMDataManager() : TPM(NULL) {
+ PMDataManager(int D) : TPM(NULL), Depth(D) {
initializeAnalysisInfo();
}
@@ -275,6 +275,8 @@
PMTopLevelManager *getTopLevelManager() { return TPM; }
void setTopLevelManager(PMTopLevelManager *T) { TPM = T; }
+ unsigned getDepth() { return Depth; }
+
private:
// Set of available Analysis. This information is used while scheduling
// pass. If a pass requires an analysis which is not not available then
@@ -288,6 +290,8 @@
// Top level manager.
// TODO : Make it a reference.
PMTopLevelManager *TPM;
+
+ unsigned Depth;
};
/// BasicBlockPassManager_New manages BasicBlockPass. It batches all the
@@ -297,7 +301,7 @@
public FunctionPass {
public:
- BasicBlockPassManager_New() { }
+ BasicBlockPassManager_New(int D) : PMDataManager(D) { }
/// Add a pass into a passmanager queue.
bool addPass(Pass *p);
@@ -326,8 +330,9 @@
public PMDataManager,
public PMTopLevelManager {
public:
- FunctionPassManagerImpl_New(ModuleProvider *P) { /* TODO */ }
- FunctionPassManagerImpl_New() {
+ FunctionPassManagerImpl_New(ModuleProvider *P, int D) :
+ PMDataManager(D) { /* TODO */ }
+ FunctionPassManagerImpl_New(int D) : PMDataManager(D) {
activeBBPassManager = NULL;
}
~FunctionPassManagerImpl_New() { /* TODO */ };
@@ -382,7 +387,9 @@
class ModulePassManager_New : public PMDataManager {
public:
- ModulePassManager_New() { activeFunctionPassManager = NULL; }
+ ModulePassManager_New(int D) : PMDataManager(D) {
+ activeFunctionPassManager = NULL;
+ }
/// Add a pass into a passmanager queue.
bool addPass(Pass *p);
@@ -412,6 +419,8 @@
public:
+ PassManagerImpl_New(int D) : PMDataManager(D) {}
+
/// 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
/// will be destroyed as well, so there is no need to delete the pass. This
@@ -615,7 +624,7 @@
/// Create new Function pass manager
FunctionPassManager_New::FunctionPassManager_New() {
- FPM = new FunctionPassManagerImpl_New();
+ FPM = new FunctionPassManagerImpl_New(0);
}
/// add - Add a pass to the queue of passes to run. This passes
@@ -679,7 +688,8 @@
activeBBPassManager->initializeAnalysisInfo();
// Create and add new manager
- activeBBPassManager = new BasicBlockPassManager_New();
+ activeBBPassManager =
+ new BasicBlockPassManager_New(getDepth() + 1);
addPassToManager(activeBBPassManager, false);
// Add pass into new manager. This time it must succeed.
@@ -818,7 +828,8 @@
activeFunctionPassManager->initializeAnalysisInfo();
// Create and add new manager
- activeFunctionPassManager = new FunctionPassManagerImpl_New();
+ activeFunctionPassManager =
+ new FunctionPassManagerImpl_New(getDepth() + 1);
addPassToManager(activeFunctionPassManager, false);
// Add pass into new manager. This time it must succeed.
@@ -905,7 +916,7 @@
bool PassManagerImpl_New::addPass(Pass *P) {
if (!activeManager || !activeManager->addPass(P)) {
- activeManager = new ModulePassManager_New();
+ activeManager = new ModulePassManager_New(getDepth() + 1);
PassManagers.push_back(activeManager);
return activeManager->addPass(P);
}
@@ -930,7 +941,7 @@
/// Create new pass manager
PassManager_New::PassManager_New() {
- PM = new PassManagerImpl_New();
+ PM = new PassManagerImpl_New(0);
}
/// add - Add a pass to the queue of passes to run. This passes ownership of
More information about the llvm-commits
mailing list