Add PassManagerType enum.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33065 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2007-01-11 01:10:25 +00:00
parent 65de742b8a
commit 25919cb780
2 changed files with 24 additions and 0 deletions

View File

@ -323,6 +323,18 @@ public:
virtual void assignPassManager(PMStack &PMS);
};
/// Different types of internal pass managers. External pass managers
/// (PassManager and FunctionPassManager) are not represented here.
/// Ordering of pass manager types is important here.
enum PassManagerType {
PMT_Unknown = 0,
PMT_ModulePassManager = 1, /// MPPassManager
PMT_CallGraphPassManager, /// CGPassManager
PMT_FunctionPassManager, /// FPPassManager
PMT_LoopPassManager, /// LPPassManager
PMT_BasicBlockPassManager /// BBPassManager
};
/// PMStack
/// Top level pass manager (see PasManager.cpp) maintains active Pass Managers
/// using PMStack. Each Pass implements assignPassManager() to connect itself

View File

@ -291,6 +291,10 @@ public:
return PassVector.size();
}
virtual PassManagerType getPassManagerType() {
assert ( 0 && "Invalid use of getPassManagerType");
return PMT_Unknown;
}
protected:
// If a FunctionPass F is the last user of ModulePass info M
@ -359,6 +363,10 @@ public:
BasicBlockPass *BP = static_cast<BasicBlockPass *>(PassVector[N]);
return BP;
}
virtual PassManagerType getPassManagerType() {
return PMT_BasicBlockPassManager;
}
};
//===----------------------------------------------------------------------===//
@ -413,6 +421,9 @@ public:
return FP;
}
virtual PassManagerType getPassManagerType() {
return PMT_FunctionPassManager;
}
private:
// Active Pass Manager
BBPassManager *activeBBPassManager;
@ -529,6 +540,7 @@ public:
return MP;
}
virtual PassManagerType getPassManagerType() { return PMT_ModulePassManager; }
private:
// Active Pass Manager
FPPassManager *activeFunctionPassManager;