Revert r167759. Ben is right this isn't likely to help much.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167809 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2012-11-13 02:56:38 +00:00
parent cf6b6131dd
commit 310fa65ab9
2 changed files with 8 additions and 12 deletions

View File

@ -263,7 +263,7 @@ private:
class PMDataManager { class PMDataManager {
public: public:
explicit PMDataManager() : TPM(NULL), PassVectorSize(0), Depth(0) { explicit PMDataManager() : TPM(NULL), Depth(0) {
initializeAnalysisInfo(); initializeAnalysisInfo();
} }
@ -344,7 +344,7 @@ public:
void dumpPreservedSet(const Pass *P) const; void dumpPreservedSet(const Pass *P) const;
virtual unsigned getNumContainedPasses() const { virtual unsigned getNumContainedPasses() const {
return PassVectorSize; return (unsigned)PassVector.size();
} }
virtual PassManagerType getPassManagerType() const { virtual PassManagerType getPassManagerType() const {
@ -369,16 +369,14 @@ protected:
// Top level manager. // Top level manager.
PMTopLevelManager *TPM; PMTopLevelManager *TPM;
// Collection of pass that are managed by this manager
SmallVector<Pass *, 16> PassVector;
// Collection of Analysis provided by Parent pass manager and // Collection of Analysis provided by Parent pass manager and
// used by current pass manager. At at time there can not be more // used by current pass manager. At at time there can not be more
// then PMT_Last active pass mangers. // then PMT_Last active pass mangers.
std::map<AnalysisID, Pass *> *InheritedAnalysis[PMT_Last]; std::map<AnalysisID, Pass *> *InheritedAnalysis[PMT_Last];
// Collection of pass that are managed by this manager
SmallVector<Pass *, 16> PassVector;
// Cache the size of PassVector
unsigned PassVectorSize;
/// isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions /// isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions
/// or higher is specified. /// or higher is specified.
@ -446,7 +444,7 @@ public:
} }
FunctionPass *getContainedPass(unsigned N) { FunctionPass *getContainedPass(unsigned N) {
assert ( N < PassVectorSize && "Pass number out of range!"); assert ( N < PassVector.size() && "Pass number out of range!");
FunctionPass *FP = static_cast<FunctionPass *>(PassVector[N]); FunctionPass *FP = static_cast<FunctionPass *>(PassVector[N]);
return FP; return FP;
} }

View File

@ -195,7 +195,7 @@ public:
} }
BasicBlockPass *getContainedPass(unsigned N) { BasicBlockPass *getContainedPass(unsigned N) {
assert(N < PassVectorSize && "Pass number out of range!"); assert(N < PassVector.size() && "Pass number out of range!");
BasicBlockPass *BP = static_cast<BasicBlockPass *>(PassVector[N]); BasicBlockPass *BP = static_cast<BasicBlockPass *>(PassVector[N]);
return BP; return BP;
} }
@ -346,7 +346,7 @@ public:
} }
ModulePass *getContainedPass(unsigned N) { ModulePass *getContainedPass(unsigned N) {
assert(N < PassVectorSize && "Pass number out of range!"); assert(N < PassVector.size() && "Pass number out of range!");
return static_cast<ModulePass *>(PassVector[N]); return static_cast<ModulePass *>(PassVector[N]);
} }
@ -963,7 +963,6 @@ void PMDataManager::add(Pass *P, bool ProcessAnalysis) {
if (!ProcessAnalysis) { if (!ProcessAnalysis) {
// Add pass // Add pass
PassVector.push_back(P); PassVector.push_back(P);
++PassVectorSize;
return; return;
} }
@ -1025,7 +1024,6 @@ void PMDataManager::add(Pass *P, bool ProcessAnalysis) {
// Add pass // Add pass
PassVector.push_back(P); PassVector.push_back(P);
++PassVectorSize;
} }