X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FPassManagers.h;h=7afb0a0fbf90cf572fe2ba65176b724ea4727c60;hb=fc699872e35ec794d7373680be6f1946fe8e9ca6;hp=3acbf0e2c07484ec7c0b25ae64cfa1b085204be7;hpb=0655668b113950521c06b85ae81f0c592d755dbd;p=oota-llvm.git diff --git a/include/llvm/PassManagers.h b/include/llvm/PassManagers.h index 3acbf0e2c07..7afb0a0fbf9 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 { @@ -352,7 +352,7 @@ public: return PMT_Unknown; } - std::map *getAvailableAnalysis() { + DenseMap *getAvailableAnalysis() { return &AvailableAnalysis; } @@ -369,16 +369,13 @@ protected: // Top level manager. PMTopLevelManager *TPM; - // 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; + // 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. + DenseMap *InheritedAnalysis[PMT_Last]; /// isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions /// or higher is specified. @@ -392,7 +389,7 @@ private: // pass. If a pass requires an analysis which is not available then // the required analysis pass is scheduled to run before the pass itself is // scheduled to run. - std::map AvailableAnalysis; + DenseMap AvailableAnalysis; // Collection of higher level analysis used by the pass managed by // this manager. @@ -422,10 +419,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 +453,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; }