[llvm-commits] [llvm] r116276 - in /llvm/trunk: include/llvm/PassManagers.h lib/VMCore/PassManager.cpp
Dan Gohman
gohman at apple.com
Mon Oct 11 17:11:19 PDT 2010
Author: djg
Date: Mon Oct 11 19:11:18 2010
New Revision: 116276
URL: http://llvm.org/viewvc/llvm-project?rev=116276&view=rev
Log:
Use SmallVectorImpl in a bunch of places.
Modified:
llvm/trunk/include/llvm/PassManagers.h
llvm/trunk/lib/VMCore/PassManager.cpp
Modified: llvm/trunk/include/llvm/PassManagers.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=116276&r1=116275&r2=116276&view=diff
==============================================================================
--- llvm/trunk/include/llvm/PassManagers.h (original)
+++ llvm/trunk/include/llvm/PassManagers.h Mon Oct 11 19:11:18 2010
@@ -184,10 +184,10 @@
void schedulePass(Pass *P);
/// 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
- void collectLastUses(SmallVector<Pass *, 12> &LastUses, Pass *P);
+ void collectLastUses(SmallVectorImpl<Pass *> &LastUses, Pass *P);
/// Find the pass that implements Analysis AID. Search immutable
/// passes and all pass managers. If desired pass is not found
@@ -205,7 +205,7 @@
ImmutablePasses.push_back(P);
}
- inline SmallVector<ImmutablePass *, 8>& getImmutablePasses() {
+ inline SmallVectorImpl<ImmutablePass *>& getImmutablePasses() {
return ImmutablePasses;
}
@@ -313,8 +313,8 @@
/// Populate RequiredPasses with analysis pass that are required by
/// pass P and are available. Populate ReqPassNotAvailable with analysis
/// pass that are required by pass P but are not available.
- void collectRequiredAnalysis(SmallVector<Pass *, 8> &RequiredPasses,
- SmallVector<AnalysisID, 8> &ReqPassNotAvailable,
+ void collectRequiredAnalysis(SmallVectorImpl<Pass *> &RequiredPasses,
+ SmallVectorImpl<AnalysisID> &ReqPassNotAvailable,
Pass *P);
/// All Required analyses should be available to the pass as it runs! Here
Modified: llvm/trunk/lib/VMCore/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=116276&r1=116275&r2=116276&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/PassManager.cpp (original)
+++ llvm/trunk/lib/VMCore/PassManager.cpp Mon Oct 11 19:11:18 2010
@@ -497,9 +497,9 @@
}
/// 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) {
- for (SmallVector<Pass *, 12>::iterator I = AnalysisPasses.begin(),
+ for (SmallVectorImpl<Pass *>::iterator I = AnalysisPasses.begin(),
E = AnalysisPasses.end(); I != E; ++I) {
Pass *AP = *I;
LastUser[AP] = P;
@@ -520,7 +520,7 @@
}
/// Collect passes whose last user is P
-void PMTopLevelManager::collectLastUses(SmallVector<Pass *, 12> &LastUses,
+void PMTopLevelManager::collectLastUses(SmallVectorImpl<Pass *> &LastUses,
Pass *P) {
DenseMap<Pass *, SmallPtrSet<Pass *, 8> >::iterator DMI =
InversedLastUser.find(P);
@@ -613,7 +613,7 @@
Pass *PMTopLevelManager::findAnalysisPass(AnalysisID AID) {
// Check pass managers
- for (SmallVector<PMDataManager *, 8>::iterator I = PassManagers.begin(),
+ for (SmallVectorImpl<PMDataManager *>::iterator I = PassManagers.begin(),
E = PassManagers.end(); I != E; ++I)
if (Pass *P = (*I)->findAnalysisPass(AID, false))
return P;
@@ -964,8 +964,8 @@
/// Populate RP with analysis pass that are required by
/// pass P and are available. Populate RP_NotAvail with analysis
/// pass that are required by pass P but are not available.
-void PMDataManager::collectRequiredAnalysis(SmallVector<Pass *, 8>&RP,
- SmallVector<AnalysisID, 8> &RP_NotAvail,
+void PMDataManager::collectRequiredAnalysis(SmallVectorImpl<Pass *> &RP,
+ SmallVectorImpl<AnalysisID> &RP_NotAvail,
Pass *P) {
AnalysisUsage *AnUsage = TPM->findAnalysisUsage(P);
const AnalysisUsage::VectorType &RequiredSet = AnUsage->getRequiredSet();
@@ -1037,7 +1037,7 @@
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) {
llvm::dbgs() << "--" << std::string(Offset*2, ' ');
(*I)->dumpPassStructure(0);
@@ -1045,7 +1045,7 @@
}
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) {
if (PMDataManager *PMD = (*I)->getAsPMDataManager())
PMD->dumpPassArguments();
@@ -1162,7 +1162,7 @@
// Destructor
PMDataManager::~PMDataManager() {
- for (SmallVector<Pass *, 8>::iterator I = PassVector.begin(),
+ for (SmallVectorImpl<Pass *>::iterator I = PassVector.begin(),
E = PassVector.end(); I != E; ++I)
delete *I;
}
More information about the llvm-commits
mailing list