Use SmallVectorImpl in a bunch of places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116276 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-10-12 00:11:18 +00:00
parent b2b9b768ef
commit ebb1834e86
2 changed files with 14 additions and 14 deletions

View File

@ -184,10 +184,10 @@ public:
void schedulePass(Pass *P); void schedulePass(Pass *P);
/// Set pass P as the last user of the given analysis passes. /// Set pass P as the last user of the given analysis passes.
void setLastUser(SmallVector<Pass *, 12> &AnalysisPasses, Pass *P); void setLastUser(SmallVectorImpl<Pass *> &AnalysisPasses, Pass *P);
/// Collect passes whose last user is P /// Collect passes whose last user is P
void collectLastUses(SmallVector<Pass *, 12> &LastUses, Pass *P); void collectLastUses(SmallVectorImpl<Pass *> &LastUses, Pass *P);
/// Find the pass that implements Analysis AID. Search immutable /// Find the pass that implements Analysis AID. Search immutable
/// passes and all pass managers. If desired pass is not found /// passes and all pass managers. If desired pass is not found
@ -205,7 +205,7 @@ public:
ImmutablePasses.push_back(P); ImmutablePasses.push_back(P);
} }
inline SmallVector<ImmutablePass *, 8>& getImmutablePasses() { inline SmallVectorImpl<ImmutablePass *>& getImmutablePasses() {
return ImmutablePasses; return ImmutablePasses;
} }
@ -313,8 +313,8 @@ public:
/// Populate RequiredPasses with analysis pass that are required by /// Populate RequiredPasses with analysis pass that are required by
/// pass P and are available. Populate ReqPassNotAvailable with analysis /// pass P and are available. Populate ReqPassNotAvailable with analysis
/// pass that are required by pass P but are not available. /// pass that are required by pass P but are not available.
void collectRequiredAnalysis(SmallVector<Pass *, 8> &RequiredPasses, void collectRequiredAnalysis(SmallVectorImpl<Pass *> &RequiredPasses,
SmallVector<AnalysisID, 8> &ReqPassNotAvailable, SmallVectorImpl<AnalysisID> &ReqPassNotAvailable,
Pass *P); Pass *P);
/// All Required analyses should be available to the pass as it runs! Here /// All Required analyses should be available to the pass as it runs! Here

View File

@ -497,9 +497,9 @@ PMTopLevelManager::PMTopLevelManager(PMDataManager *PMDM) {
} }
/// Set pass P as the last user of the given analysis passes. /// Set pass P as the last user of the given analysis passes.
void PMTopLevelManager::setLastUser(SmallVector<Pass *, 12> &AnalysisPasses, void PMTopLevelManager::setLastUser(SmallVectorImpl<Pass *> &AnalysisPasses,
Pass *P) { Pass *P) {
for (SmallVector<Pass *, 12>::iterator I = AnalysisPasses.begin(), for (SmallVectorImpl<Pass *>::iterator I = AnalysisPasses.begin(),
E = AnalysisPasses.end(); I != E; ++I) { E = AnalysisPasses.end(); I != E; ++I) {
Pass *AP = *I; Pass *AP = *I;
LastUser[AP] = P; LastUser[AP] = P;
@ -520,7 +520,7 @@ void PMTopLevelManager::setLastUser(SmallVector<Pass *, 12> &AnalysisPasses,
} }
/// Collect passes whose last user is P /// Collect passes whose last user is P
void PMTopLevelManager::collectLastUses(SmallVector<Pass *, 12> &LastUses, void PMTopLevelManager::collectLastUses(SmallVectorImpl<Pass *> &LastUses,
Pass *P) { Pass *P) {
DenseMap<Pass *, SmallPtrSet<Pass *, 8> >::iterator DMI = DenseMap<Pass *, SmallPtrSet<Pass *, 8> >::iterator DMI =
InversedLastUser.find(P); InversedLastUser.find(P);
@ -613,7 +613,7 @@ void PMTopLevelManager::schedulePass(Pass *P) {
Pass *PMTopLevelManager::findAnalysisPass(AnalysisID AID) { Pass *PMTopLevelManager::findAnalysisPass(AnalysisID AID) {
// Check pass managers // Check pass managers
for (SmallVector<PMDataManager *, 8>::iterator I = PassManagers.begin(), for (SmallVectorImpl<PMDataManager *>::iterator I = PassManagers.begin(),
E = PassManagers.end(); I != E; ++I) E = PassManagers.end(); I != E; ++I)
if (Pass *P = (*I)->findAnalysisPass(AID, false)) if (Pass *P = (*I)->findAnalysisPass(AID, false))
return P; return P;
@ -964,8 +964,8 @@ void PMDataManager::add(Pass *P, bool ProcessAnalysis) {
/// Populate RP with analysis pass that are required by /// Populate RP with analysis pass that are required by
/// pass P and are available. Populate RP_NotAvail with analysis /// pass P and are available. Populate RP_NotAvail with analysis
/// pass that are required by pass P but are not available. /// pass that are required by pass P but are not available.
void PMDataManager::collectRequiredAnalysis(SmallVector<Pass *, 8>&RP, void PMDataManager::collectRequiredAnalysis(SmallVectorImpl<Pass *> &RP,
SmallVector<AnalysisID, 8> &RP_NotAvail, SmallVectorImpl<AnalysisID> &RP_NotAvail,
Pass *P) { Pass *P) {
AnalysisUsage *AnUsage = TPM->findAnalysisUsage(P); AnalysisUsage *AnUsage = TPM->findAnalysisUsage(P);
const AnalysisUsage::VectorType &RequiredSet = AnUsage->getRequiredSet(); const AnalysisUsage::VectorType &RequiredSet = AnUsage->getRequiredSet();
@ -1037,7 +1037,7 @@ void PMDataManager::dumpLastUses(Pass *P, unsigned Offset) const{
TPM->collectLastUses(LUses, P); TPM->collectLastUses(LUses, P);
for (SmallVector<Pass *, 12>::iterator I = LUses.begin(), for (SmallVectorImpl<Pass *>::iterator I = LUses.begin(),
E = LUses.end(); I != E; ++I) { E = LUses.end(); I != E; ++I) {
llvm::dbgs() << "--" << std::string(Offset*2, ' '); llvm::dbgs() << "--" << std::string(Offset*2, ' ');
(*I)->dumpPassStructure(0); (*I)->dumpPassStructure(0);
@ -1045,7 +1045,7 @@ void PMDataManager::dumpLastUses(Pass *P, unsigned Offset) const{
} }
void PMDataManager::dumpPassArguments() const { void PMDataManager::dumpPassArguments() const {
for (SmallVector<Pass *, 8>::const_iterator I = PassVector.begin(), for (SmallVectorImpl<Pass *>::const_iterator I = PassVector.begin(),
E = PassVector.end(); I != E; ++I) { E = PassVector.end(); I != E; ++I) {
if (PMDataManager *PMD = (*I)->getAsPMDataManager()) if (PMDataManager *PMD = (*I)->getAsPMDataManager())
PMD->dumpPassArguments(); PMD->dumpPassArguments();
@ -1162,7 +1162,7 @@ Pass *PMDataManager::getOnTheFlyPass(Pass *P, AnalysisID PI, Function &F) {
// Destructor // Destructor
PMDataManager::~PMDataManager() { PMDataManager::~PMDataManager() {
for (SmallVector<Pass *, 8>::iterator I = PassVector.begin(), for (SmallVectorImpl<Pass *>::iterator I = PassVector.begin(),
E = PassVector.end(); I != E; ++I) E = PassVector.end(); I != E; ++I)
delete *I; delete *I;
} }