/// PMTopLevelManager manages LastUser info and collects common APIs used by
/// top level pass managers.
class PMTopLevelManager {
-public:
+protected:
+ explicit PMTopLevelManager(PMDataManager *PMDM);
virtual unsigned getNumContainedManagers() const {
return (unsigned)PassManagers.size();
}
- /// Schedule pass P for execution. Make sure that passes required by
- /// P are run before P is run. Update analysis info maintained by
- /// the manager. Remove dead passes. This is a recursive function.
- void schedulePass(Pass *P);
+ void initializeAllAnalysisInfo();
+private:
/// This is implemented by top level pass manager and used by
/// schedulePass() to add analysis info passes that are not available.
virtual void addTopLevelPass(Pass *P) = 0;
+public:
+ /// Schedule pass P for execution. Make sure that passes required by
+ /// P are run before P is run. Update analysis info maintained by
+ /// the manager. Remove dead passes. This is a recursive function.
+ void schedulePass(Pass *P);
+
/// Set pass P as the last user of the given analysis passes.
- void setLastUser(SmallVector<Pass *, 12> &AnalysisPasses, Pass *P);
+ void setLastUser(const SmallVectorImpl<Pass *> &AnalysisPasses, Pass *P);
/// Collect passes whose last user is P
- void collectLastUses(SmallVector<Pass *, 12> &LastUses, Pass *P);
+ void collectLastUses(SmallVectorImpl<Pass *> &LastUses, Pass *P);
/// Find the pass that implements Analysis AID. Search immutable
/// passes and all pass managers. If desired pass is not found
/// Find analysis usage information for the pass P.
AnalysisUsage *findAnalysisUsage(Pass *P);
- explicit PMTopLevelManager(PMDataManager *PMDM);
virtual ~PMTopLevelManager();
/// Add immutable pass and initialize it.
ImmutablePasses.push_back(P);
}
- inline SmallVector<ImmutablePass *, 8>& getImmutablePasses() {
+ inline SmallVectorImpl<ImmutablePass *>& getImmutablePasses() {
return ImmutablePasses;
}
void dumpPasses() const;
void dumpArguments() const;
- void initializeAllAnalysisInfo();
-
// Active Pass Managers
PMStack activeStack;
/// Populate RequiredPasses with analysis pass that are required by
/// pass P and are available. Populate ReqPassNotAvailable with analysis
/// pass that are required by pass P but are not available.
- void collectRequiredAnalysis(SmallVector<Pass *, 8> &RequiredPasses,
- SmallVector<AnalysisID, 8> &ReqPassNotAvailable,
+ void collectRequiredAnalysis(SmallVectorImpl<Pass *> &RequiredPasses,
+ SmallVectorImpl<AnalysisID> &ReqPassNotAvailable,
Pass *P);
/// All Required analyses should be available to the pass as it runs! Here