X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FPassManagers.h;h=7afb0a0fbf90cf572fe2ba65176b724ea4727c60;hb=fe0c244633aff93111063224317ec9c20d3dbcf4;hp=fa29f50ccf771d04def5557024ed8887e44e3f63;hpb=11e43291540db9d885b736cbd652558faab80955;p=oota-llvm.git diff --git a/include/llvm/PassManagers.h b/include/llvm/PassManagers.h index fa29f50ccf7..7afb0a0fbf9 100644 --- a/include/llvm/PassManagers.h +++ b/include/llvm/PassManagers.h @@ -14,12 +14,13 @@ #ifndef LLVM_PASSMANAGERS_H #define LLVM_PASSMANAGERS_H -#include "llvm/Pass.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" -#include +#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/Pass.h" #include +#include //===----------------------------------------------------------------------===// // Overview: @@ -167,7 +168,7 @@ class PMTopLevelManager { protected: explicit PMTopLevelManager(PMDataManager *PMDM); - virtual unsigned getNumContainedManagers() const { + unsigned getNumContainedManagers() const { return (unsigned)PassManagers.size(); } @@ -184,7 +185,7 @@ public: void schedulePass(Pass *P); /// Set pass P as the last user of the given analysis passes. - void setLastUser(const SmallVectorImpl &AnalysisPasses, Pass *P); + void setLastUser(ArrayRef AnalysisPasses, Pass *P); /// Collect passes whose last user is P void collectLastUses(SmallVectorImpl &LastUses, Pass *P); @@ -342,7 +343,7 @@ public: void dumpRequiredSet(const Pass *P) const; void dumpPreservedSet(const Pass *P) const; - virtual unsigned getNumContainedPasses() const { + unsigned getNumContainedPasses() const { return (unsigned)PassVector.size(); } @@ -351,7 +352,7 @@ public: return PMT_Unknown; } - std::map *getAvailableAnalysis() { + DenseMap *getAvailableAnalysis() { return &AvailableAnalysis; } @@ -374,8 +375,7 @@ protected: // 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]; - + DenseMap *InheritedAnalysis[PMT_Last]; /// isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions /// or higher is specified. @@ -389,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. @@ -419,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);