diff options
author | Dan Gohman <gohman@apple.com> | 2008-03-14 18:14:29 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-03-14 18:14:29 +0000 |
commit | d7a3541a059d8b2b17b67ea4e8d2bfaada6d4bdb (patch) | |
tree | 26b9085e734a741d54e56ab05634f319a87b401e /include/llvm/PassManagers.h | |
parent | 8f5422c24b318d2680eafc177f199a180d5054da (diff) | |
download | external_llvm-d7a3541a059d8b2b17b67ea4e8d2bfaada6d4bdb.zip external_llvm-d7a3541a059d8b2b17b67ea4e8d2bfaada6d4bdb.tar.gz external_llvm-d7a3541a059d8b2b17b67ea4e8d2bfaada6d4bdb.tar.bz2 |
Move the PMStack class out of Pass.h and into PassManagers.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/PassManagers.h')
-rw-r--r-- | include/llvm/PassManagers.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/llvm/PassManagers.h b/include/llvm/PassManagers.h index eaa6f44..1047e70 100644 --- a/include/llvm/PassManagers.h +++ b/include/llvm/PassManagers.h @@ -13,6 +13,7 @@ #include "llvm/PassManager.h" #include "llvm/ADT/SmallVector.h" +#include <deque> //===----------------------------------------------------------------------===// // Overview: @@ -106,6 +107,36 @@ enum PassDebuggingString { }; //===----------------------------------------------------------------------===// +// PMStack +// +/// PMStack +/// Top level pass managers (see PassManager.cpp) maintain active Pass Managers +/// using PMStack. Each Pass implements assignPassManager() to connect itself +/// with appropriate manager. assignPassManager() walks PMStack to find +/// suitable manager. +/// +/// PMStack is just a wrapper around standard deque that overrides pop() and +/// push() methods. +class PMStack { +public: + typedef std::deque<PMDataManager *>::reverse_iterator iterator; + iterator begin() { return S.rbegin(); } + iterator end() { return S.rend(); } + + void handleLastUserOverflow(); + + void pop(); + inline PMDataManager *top() { return S.back(); } + void push(PMDataManager *PM); + inline bool empty() { return S.empty(); } + + void dump(); +private: + std::deque<PMDataManager *> S; +}; + + +//===----------------------------------------------------------------------===// // PMTopLevelManager // /// PMTopLevelManager manages LastUser info and collects common APIs used by |