summaryrefslogtreecommitdiffstats
path: root/lib/VMCore/PassManager.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-07-20 01:19:58 +0000
committerOwen Anderson <resistor@mac.com>2010-07-20 01:19:58 +0000
commit8ba15cb7099d9eadcb345328228d77ffa5afa42d (patch)
tree48778ce4b577178912f4a72d48b761056aae92ae /lib/VMCore/PassManager.cpp
parentfb272ad614e923bebdf226ff9d3fbce5e2ae1192 (diff)
downloadexternal_llvm-8ba15cb7099d9eadcb345328228d77ffa5afa42d.zip
external_llvm-8ba15cb7099d9eadcb345328228d77ffa5afa42d.tar.gz
external_llvm-8ba15cb7099d9eadcb345328228d77ffa5afa42d.tar.bz2
Separate PassInfo into two classes: a constructor-free superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/PassManager.cpp')
-rw-r--r--lib/VMCore/PassManager.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp
index 4cf5501..9e0be3b 100644
--- a/lib/VMCore/PassManager.cpp
+++ b/lib/VMCore/PassManager.cpp
@@ -332,7 +332,8 @@ public:
/// Return function pass corresponding to PassInfo PI, that is
/// required by module pass MP. Instantiate analysis pass, by using
/// its runOnFunction() for function F.
- virtual Pass* getOnTheFlyPass(Pass *MP, const PassInfo *PI, Function &F);
+ virtual Pass* getOnTheFlyPass(Pass *MP, const StaticPassInfo *PI,
+ Function &F);
virtual const char *getPassName() const {
return "Module Pass Manager";
@@ -632,7 +633,7 @@ Pass *PMTopLevelManager::findAnalysisPass(AnalysisID AID) {
for (SmallVector<ImmutablePass *, 8>::iterator I = ImmutablePasses.begin(),
E = ImmutablePasses.end(); P == NULL && I != E; ++I) {
- const PassInfo *PI = (*I)->getPassInfo();
+ const StaticPassInfo *PI = (*I)->getPassInfo();
if (PI == AID)
P = *I;
@@ -728,7 +729,7 @@ PMTopLevelManager::~PMTopLevelManager() {
/// Augement AvailableAnalysis by adding analysis made available by pass P.
void PMDataManager::recordAvailableAnalysis(Pass *P) {
- const PassInfo *PI = P->getPassInfo();
+ const StaticPassInfo *PI = P->getPassInfo();
if (PI == 0) return;
AvailableAnalysis[PI] = P;
@@ -867,7 +868,7 @@ void PMDataManager::freePass(Pass *P, StringRef Msg,
P->releaseMemory();
}
- if (const PassInfo *PI = P->getPassInfo()) {
+ if (const StaticPassInfo *PI = P->getPassInfo()) {
// Remove the pass itself (if it is not already removed).
AvailableAnalysis.erase(PI);
@@ -1051,7 +1052,7 @@ void PMDataManager::dumpPassArguments() const {
if (PMDataManager *PMD = (*I)->getAsPMDataManager())
PMD->dumpPassArguments();
else
- if (const PassInfo *PI = (*I)->getPassInfo())
+ if (const StaticPassInfo *PI = (*I)->getPassInfo())
if (!PI->isAnalysisGroup())
dbgs() << " -" << PI->getPassArgument();
}
@@ -1154,7 +1155,8 @@ void PMDataManager::addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) {
llvm_unreachable("Unable to schedule pass");
}
-Pass *PMDataManager::getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F) {
+Pass *PMDataManager::getOnTheFlyPass(Pass *P, const StaticPassInfo *PI,
+ Function &F) {
assert(0 && "Unable to find on the fly pass");
return NULL;
}
@@ -1173,7 +1175,7 @@ Pass *AnalysisResolver::getAnalysisIfAvailable(AnalysisID ID, bool dir) const {
return PM.findAnalysisPass(ID, dir);
}
-Pass *AnalysisResolver::findImplPass(Pass *P, const PassInfo *AnalysisPI,
+Pass *AnalysisResolver::findImplPass(Pass *P, const StaticPassInfo *AnalysisPI,
Function &F) {
return PM.getOnTheFlyPass(P, AnalysisPI, F);
}
@@ -1568,7 +1570,8 @@ void MPPassManager::addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) {
/// Return function pass corresponding to PassInfo PI, that is
/// required by module pass MP. Instantiate analysis pass, by using
/// its runOnFunction() for function F.
-Pass* MPPassManager::getOnTheFlyPass(Pass *MP, const PassInfo *PI, Function &F){
+Pass* MPPassManager::getOnTheFlyPass(Pass *MP, const StaticPassInfo *PI,
+ Function &F){
FunctionPassManagerImpl *FPP = OnTheFlyManagers[MP];
assert(FPP && "Unable to find on the fly pass");