summaryrefslogtreecommitdiff
path: root/include/llvm/PassAnalysisSupport.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-01-05 20:16:23 +0000
committerDevang Patel <dpatel@apple.com>2007-01-05 20:16:23 +0000
commitcccd80dfa316019047f053c55f1b94f63b17c043 (patch)
tree08e81a084c3f11a8f9fab7bd1b73573c581168fe /include/llvm/PassAnalysisSupport.h
parent3b29264c11aff1248ad56716ac4e2db540a82938 (diff)
downloadllvm-cccd80dfa316019047f053c55f1b94f63b17c043.tar.gz
llvm-cccd80dfa316019047f053c55f1b94f63b17c043.tar.bz2
llvm-cccd80dfa316019047f053c55f1b94f63b17c043.tar.xz
Remove old pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32927 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/PassAnalysisSupport.h')
-rw-r--r--include/llvm/PassAnalysisSupport.h36
1 files changed, 3 insertions, 33 deletions
diff --git a/include/llvm/PassAnalysisSupport.h b/include/llvm/PassAnalysisSupport.h
index 7dbaa89369..f591400d27 100644
--- a/include/llvm/PassAnalysisSupport.h
+++ b/include/llvm/PassAnalysisSupport.h
@@ -175,8 +175,6 @@ struct AnalysisResolver {
void startPass(Pass *P) {}
void endPass(Pass *P) {}
-protected:
- void setAnalysisResolver(Pass *P, AnalysisResolver *AR);
};
/// getAnalysisToUpdate<AnalysisType>() - This function is used by subclasses
@@ -189,19 +187,12 @@ protected:
///
template<typename AnalysisType>
AnalysisType *Pass::getAnalysisToUpdate() const {
-#ifdef USE_OLD_PASSMANAGER
- assert(Resolver && "Pass not resident in a PassManager object!");
-#else
assert(Resolver_New && "Pass not resident in a PassManager object!");
-#endif
+
const PassInfo *PI = getClassPassInfo<AnalysisType>();
if (PI == 0) return 0;
-#ifdef USE_OLD_PASSMANAGER
- return dynamic_cast<AnalysisType*>(Resolver->getAnalysisToUpdate(PI));
-#else
return dynamic_cast<AnalysisType*>
(Resolver_New->getAnalysisToUpdate(PI, true));
-#endif
}
/// getAnalysis<AnalysisType>() - This function is used by subclasses to get
@@ -210,34 +201,14 @@ AnalysisType *Pass::getAnalysisToUpdate() const {
///
template<typename AnalysisType>
AnalysisType &Pass::getAnalysis() const {
-#ifdef USE_OLD_PASSMANAGER
- assert(Resolver && "Pass has not been inserted into a PassManager object!");
-#else
- assert(Resolver_New&&"Pass has not been inserted into a PassManager object!");
-#endif
+ assert(Resolver_New &&"Pass has not been inserted into a PassManager object!");
+
return getAnalysisID<AnalysisType>(getClassPassInfo<AnalysisType>());
}
template<typename AnalysisType>
AnalysisType &Pass::getAnalysisID(const PassInfo *PI) const {
assert(PI && "getAnalysis for unregistered pass!");
-#ifdef USE_OLD_PASSMANAGER
- assert(Resolver && "Pass has not been inserted into a PassManager object!");
-
- // PI *must* appear in AnalysisImpls. Because the number of passes used
- // should be a small number, we just do a linear search over a (dense)
- // vector.
- Pass *ResultPass = 0;
- for (unsigned i = 0; ; ++i) {
- assert(i != AnalysisImpls.size() &&
- "getAnalysis*() called on an analysis that was not "
- "'required' by pass!");
- if (AnalysisImpls[i].first == PI) {
- ResultPass = AnalysisImpls[i].second;
- break;
- }
- }
-#else
assert(Resolver_New&&"Pass has not been inserted into a PassManager object!");
// PI *must* appear in AnalysisImpls. Because the number of passes used
// should be a small number, we just do a linear search over a (dense)
@@ -247,7 +218,6 @@ AnalysisType &Pass::getAnalysisID(const PassInfo *PI) const {
"getAnalysis*() called on an analysis that was not "
"'required' by pass!");
-#endif
// Because the AnalysisType may not be a subclass of pass (for
// AnalysisGroups), we must use dynamic_cast here to potentially adjust the
// return pointer (because the class may multiply inherit, once from pass,