diff options
author | Dan Gohman <gohman@apple.com> | 2010-08-07 00:53:01 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-08-07 00:53:01 +0000 |
commit | 4bdeede8c7ea307b3f6192ec4f425debda948998 (patch) | |
tree | 77647b1b1238dd31140115939429cbe3beb238fe | |
parent | 11112e0d7b1fb2741ed65a5085037918d1425916 (diff) | |
download | llvm-4bdeede8c7ea307b3f6192ec4f425debda948998.tar.gz llvm-4bdeede8c7ea307b3f6192ec4f425debda948998.tar.bz2 llvm-4bdeede8c7ea307b3f6192ec4f425debda948998.tar.xz |
Tidy up PMStack. Add a bunch of consts, use std::vector instead of
std::deque, since this is a stack and only supports push/pop on
one end, and remove an unimplemented declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110495 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Analysis/LoopPass.h | 1 | ||||
-rw-r--r-- | include/llvm/PassManagers.h | 26 |
2 files changed, 13 insertions, 14 deletions
diff --git a/include/llvm/Analysis/LoopPass.h b/include/llvm/Analysis/LoopPass.h index 3e1c2a9418..0d92de79f9 100644 --- a/include/llvm/Analysis/LoopPass.h +++ b/include/llvm/Analysis/LoopPass.h @@ -19,6 +19,7 @@ #include "llvm/Pass.h" #include "llvm/PassManagers.h" #include "llvm/Function.h" +#include <deque> namespace llvm { diff --git a/include/llvm/PassManagers.h b/include/llvm/PassManagers.h index 1f9b9821d5..c592a084af 100644 --- a/include/llvm/PassManagers.h +++ b/include/llvm/PassManagers.h @@ -18,7 +18,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/DenseMap.h" -#include <deque> +#include <vector> #include <map> //===----------------------------------------------------------------------===// @@ -138,30 +138,28 @@ public: //===----------------------------------------------------------------------===// // PMStack // -/// PMStack +/// PMStack - This class implements a stack data structure of PMDataManager +/// pointers. +/// /// 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(); + typedef std::vector<PMDataManager *>::const_reverse_iterator iterator; + iterator begin() const { return S.rbegin(); } + iterator end() const { return S.rend(); } void pop(); - inline PMDataManager *top() { return S.back(); } + PMDataManager *top() const { return S.back(); } void push(PMDataManager *PM); - inline bool empty() { return S.empty(); } + bool empty() const { return S.empty(); } + + void dump() const; - void dump(); private: - std::deque<PMDataManager *> S; + std::vector<PMDataManager *> S; }; |