class PMDataManager {
public:
- explicit PMDataManager() : TPM(NULL), Depth(0) {
+ explicit PMDataManager() : TPM(NULL), PassVectorSize(0), Depth(0) {
initializeAnalysisInfo();
}
void dumpPreservedSet(const Pass *P) const;
virtual unsigned getNumContainedPasses() const {
- return (unsigned)PassVector.size();
+ return PassVectorSize;
}
virtual PassManagerType getPassManagerType() const {
// Top level manager.
PMTopLevelManager *TPM;
- // Collection of pass that are managed by this manager
- SmallVector<Pass *, 16> PassVector;
-
// Collection of Analysis provided by Parent pass manager and
// used by current pass manager. At at time there can not be more
// then PMT_Last active pass mangers.
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
/// or higher is specified.
}
FunctionPass *getContainedPass(unsigned N) {
- assert ( N < PassVector.size() && "Pass number out of range!");
+ assert ( N < PassVectorSize && "Pass number out of range!");
FunctionPass *FP = static_cast<FunctionPass *>(PassVector[N]);
return FP;
}
}
BasicBlockPass *getContainedPass(unsigned N) {
- assert(N < PassVector.size() && "Pass number out of range!");
+ assert(N < PassVectorSize && "Pass number out of range!");
BasicBlockPass *BP = static_cast<BasicBlockPass *>(PassVector[N]);
return BP;
}
}
ModulePass *getContainedPass(unsigned N) {
- assert(N < PassVector.size() && "Pass number out of range!");
+ assert(N < PassVectorSize && "Pass number out of range!");
return static_cast<ModulePass *>(PassVector[N]);
}
if (!ProcessAnalysis) {
// Add pass
PassVector.push_back(P);
+ ++PassVectorSize;
return;
}
// Add pass
PassVector.push_back(P);
+ ++PassVectorSize;
}