X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=include%2Fllvm%2FPassManagers.h;h=fac792824fc41c30304b66682102c38fbf5a90dc;hb=b09c146b116359616f6cbd4c8b3328607e00ff42;hp=3acbf0e2c07484ec7c0b25ae64cfa1b085204be7;hpb=0655668b113950521c06b85ae81f0c592d755dbd;p=oota-llvm.git diff --git a/include/llvm/PassManagers.h b/include/llvm/PassManagers.h index 3acbf0e2c07..fac792824fc 100644 --- a/include/llvm/PassManagers.h +++ b/include/llvm/PassManagers.h @@ -14,13 +14,13 @@ #ifndef LLVM_PASSMANAGERS_H #define LLVM_PASSMANAGERS_H -#include "llvm/Pass.h" #include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/DenseMap.h" -#include +#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/Pass.h" #include +#include //===----------------------------------------------------------------------===// // Overview: @@ -168,7 +168,7 @@ class PMTopLevelManager { protected: explicit PMTopLevelManager(PMDataManager *PMDM); - virtual unsigned getNumContainedManagers() const { + unsigned getNumContainedManagers() const { return (unsigned)PassManagers.size(); } @@ -263,7 +263,7 @@ private: class PMDataManager { public: - explicit PMDataManager() : TPM(NULL), PassVectorSize(0), Depth(0) { + explicit PMDataManager() : TPM(NULL), Depth(0) { initializeAnalysisInfo(); } @@ -343,8 +343,8 @@ public: void dumpRequiredSet(const Pass *P) const; void dumpPreservedSet(const Pass *P) const; - virtual unsigned getNumContainedPasses() const { - return PassVectorSize; + unsigned getNumContainedPasses() const { + return (unsigned)PassVector.size(); } virtual PassManagerType getPassManagerType() const { @@ -369,16 +369,14 @@ protected: // Top level manager. PMTopLevelManager *TPM; + // Collection of pass that are managed by this manager + SmallVector PassVector; + // Collection of Analysis provided by Parent pass manager and // used by current pass manager. At at time there can not be more // then PMT_Last active pass mangers. std::map *InheritedAnalysis[PMT_Last]; - // Collection of pass that are managed by this manager - SmallVector PassVector; - - // Cache the size of PassVector - unsigned PassVectorSize; /// isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions /// or higher is specified. @@ -422,10 +420,20 @@ public: /// cleanup - After running all passes, clean up pass manager cache. void cleanup(); + /// doInitialization - Overrides ModulePass doInitialization for global + /// initialization tasks + /// + using ModulePass::doInitialization; + /// doInitialization - Run all of the initializers for the function passes. /// bool doInitialization(Module &M); + /// doFinalization - Overrides ModulePass doFinalization for global + /// finalization tasks + /// + using ModulePass::doFinalization; + /// doFinalization - Run all of the finalizers for the function passes. /// bool doFinalization(Module &M); @@ -446,7 +454,7 @@ public: } FunctionPass *getContainedPass(unsigned N) { - assert ( N < PassVectorSize && "Pass number out of range!"); + assert ( N < PassVector.size() && "Pass number out of range!"); FunctionPass *FP = static_cast(PassVector[N]); return FP; }