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 | 404c58847ecaed2ff522603191aeceb1e695b54c (patch) | |
tree | 13113ce968f7be36776bc9dd89d9bd657599a259 | |
parent | 093b42fc7cee448ccc41297dd27936ed1c6eb81d (diff) | |
download | bcm5719-llvm-404c58847ecaed2ff522603191aeceb1e695b54c.tar.gz bcm5719-llvm-404c58847ecaed2ff522603191aeceb1e695b54c.zip |
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.
llvm-svn: 110495
-rw-r--r-- | llvm/include/llvm/Analysis/LoopPass.h | 1 | ||||
-rw-r--r-- | llvm/include/llvm/PassManagers.h | 26 |
2 files changed, 13 insertions, 14 deletions
diff --git a/llvm/include/llvm/Analysis/LoopPass.h b/llvm/include/llvm/Analysis/LoopPass.h index 3e1c2a94180..0d92de79f9c 100644 --- a/llvm/include/llvm/Analysis/LoopPass.h +++ b/llvm/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/llvm/include/llvm/PassManagers.h b/llvm/include/llvm/PassManagers.h index 1f9b9821d59..c592a084afc 100644 --- a/llvm/include/llvm/PassManagers.h +++ b/llvm/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; }; |