Add getPotentialPassManagerType(). No functionality change, yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36149 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2007-04-16 18:51:25 +00:00
parent 62dc4dd522
commit 8f93b7fc36
3 changed files with 31 additions and 1 deletions

View File

@ -57,6 +57,10 @@ class LoopPass : public Pass {
virtual void assignPassManager(PMStack &PMS, virtual void assignPassManager(PMStack &PMS,
PassManagerType PMT = PMT_LoopPassManager); PassManagerType PMT = PMT_LoopPassManager);
/// Return what kind of Pass Manager can manage this pass.
virtual PassManagerType getPotentialPassManagerType() const {
return PMT_LoopPassManager;
}
}; };
class LPPassManager : public FunctionPass, public PMDataManager { class LPPassManager : public FunctionPass, public PMDataManager {

View File

@ -54,6 +54,11 @@ struct CallGraphSCCPass : public Pass {
virtual void assignPassManager(PMStack &PMS, virtual void assignPassManager(PMStack &PMS,
PassManagerType PMT = PMT_CallGraphPassManager); PassManagerType PMT = PMT_CallGraphPassManager);
/// Return what kind of Pass Manager can manage this pass.
virtual PassManagerType getPotentialPassManagerType() const {
return PMT_CallGraphPassManager;
}
/// getAnalysisUsage - For this class, we declare that we require and preserve /// getAnalysisUsage - For this class, we declare that we require and preserve
/// the call graph. If the derived class implements this method, it should /// the call graph. If the derived class implements this method, it should
/// always explicitly call the implementation here. /// always explicitly call the implementation here.

View File

@ -126,6 +126,11 @@ public:
PassManagerType T = PMT_Unknown) {} PassManagerType T = PMT_Unknown) {}
/// Check if available pass managers are suitable for this pass or not. /// Check if available pass managers are suitable for this pass or not.
virtual void preparePassManager(PMStack &PMS) {} virtual void preparePassManager(PMStack &PMS) {}
/// Return what kind of Pass Manager can manage this pass.
virtual PassManagerType getPotentialPassManagerType() const {
return PMT_Unknown;
}
// Access AnalysisResolver // Access AnalysisResolver
inline void setResolver(AnalysisResolver *AR) { Resolver = AR; } inline void setResolver(AnalysisResolver *AR) { Resolver = AR; }
@ -193,7 +198,7 @@ public:
template<typename AnalysisType> template<typename AnalysisType>
AnalysisType &getAnalysisID(const PassInfo *PI) const; AnalysisType &getAnalysisID(const PassInfo *PI) const;
}; };
inline std::ostream &operator<<(std::ostream &OS, const Pass &P) { inline std::ostream &operator<<(std::ostream &OS, const Pass &P) {
@ -216,6 +221,12 @@ public:
virtual void assignPassManager(PMStack &PMS, virtual void assignPassManager(PMStack &PMS,
PassManagerType T = PMT_ModulePassManager); PassManagerType T = PMT_ModulePassManager);
/// Return what kind of Pass Manager can manage this pass.
virtual PassManagerType getPotentialPassManagerType() const {
return PMT_ModulePassManager;
}
// Force out-of-line virtual method. // Force out-of-line virtual method.
virtual ~ModulePass(); virtual ~ModulePass();
}; };
@ -283,6 +294,11 @@ public:
virtual void assignPassManager(PMStack &PMS, virtual void assignPassManager(PMStack &PMS,
PassManagerType T = PMT_FunctionPassManager); PassManagerType T = PMT_FunctionPassManager);
/// Return what kind of Pass Manager can manage this pass.
virtual PassManagerType getPotentialPassManagerType() const {
return PMT_FunctionPassManager;
}
}; };
@ -338,6 +354,11 @@ public:
virtual void assignPassManager(PMStack &PMS, virtual void assignPassManager(PMStack &PMS,
PassManagerType T = PMT_BasicBlockPassManager); PassManagerType T = PMT_BasicBlockPassManager);
/// Return what kind of Pass Manager can manage this pass.
virtual PassManagerType getPotentialPassManagerType() const {
return PMT_BasicBlockPassManager;
}
}; };
/// PMStack /// PMStack