Move the PMStack class out of Pass.h and into PassManagers.h.

llvm-svn: 48367
This commit is contained in:
Dan Gohman 2008-03-14 18:14:29 +00:00
parent b561de7455
commit 87ea2aba62
3 changed files with 32 additions and 28 deletions

View File

@ -24,6 +24,7 @@ namespace llvm {
class LPPassManager;
class Function;
class PMStack;
class LoopPass : public Pass {

View File

@ -32,7 +32,6 @@
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/Streams.h"
#include <vector>
#include <deque>
#include <map>
#include <iosfwd>
#include <cassert>
@ -369,33 +368,6 @@ public:
}
};
/// PMStack
/// Top level pass manager (see PassManager.cpp) maintains 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;
};
/// If the user specifies the -time-passes argument on an LLVM tool command line
/// then the value of this boolean will be true, otherwise false.
/// @brief This is the storage for the -time-passes option.

View File

@ -13,6 +13,7 @@
#include "llvm/PassManager.h"
#include "llvm/ADT/SmallVector.h"
#include <deque>
//===----------------------------------------------------------------------===//
// Overview:
@ -105,6 +106,36 @@ enum PassDebuggingString {
ON_CG_MSG // "' on Call Graph ...\n'"
};
//===----------------------------------------------------------------------===//
// 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
//