summaryrefslogtreecommitdiff
path: root/include/llvm/PassAnalysisSupport.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-01-05 22:47:07 +0000
committerDevang Patel <dpatel@apple.com>2007-01-05 22:47:07 +0000
commitcde53d3c1e9d6a2add5de847b44818fbb1d69c20 (patch)
tree421f97547505d2adf8b8fe6a9683fe8cd92963ca /include/llvm/PassAnalysisSupport.h
parent8b31b2dea65999c4bdb27b1cd655f25a63aaad01 (diff)
downloadllvm-cde53d3c1e9d6a2add5de847b44818fbb1d69c20.tar.gz
llvm-cde53d3c1e9d6a2add5de847b44818fbb1d69c20.tar.bz2
llvm-cde53d3c1e9d6a2add5de847b44818fbb1d69c20.tar.xz
1) Remove old AnalysisResolver.
2) Rename AnalysisResolver_New as AnalysisResolver git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32938 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/PassAnalysisSupport.h')
-rw-r--r--include/llvm/PassAnalysisSupport.h49
1 files changed, 9 insertions, 40 deletions
diff --git a/include/llvm/PassAnalysisSupport.h b/include/llvm/PassAnalysisSupport.h
index f591400d27..d832485b83 100644
--- a/include/llvm/PassAnalysisSupport.h
+++ b/include/llvm/PassAnalysisSupport.h
@@ -106,12 +106,12 @@ public:
// the pass.
//
class PMDataManager;
-class AnalysisResolver_New {
+class AnalysisResolver {
private:
- AnalysisResolver_New(); // DO NOT IMPLEMENT
+ AnalysisResolver(); // DO NOT IMPLEMENT
public:
- AnalysisResolver_New(PMDataManager &P) : PM(P) { }
+ AnalysisResolver(PMDataManager &P) : PM(P) { }
inline PMDataManager &getPMDataManager() { return PM; }
@@ -137,7 +137,7 @@ public:
// AnalysisImpls - This keeps track of which passes implements the interfaces
// that are required by the current pass (to implement getAnalysis()).
- // NOTE : Remove AnalysisImpls from class Pass, when AnalysisResolver_New
+ // NOTE : Remove AnalysisImpls from class Pass, when AnalysisResolver
// replaces AnalysisResolver
std::vector<std::pair<const PassInfo*, Pass*> > AnalysisImpls;
@@ -146,37 +146,6 @@ private:
PMDataManager &PM;
};
-//===----------------------------------------------------------------------===//
-// AnalysisResolver - Simple interface implemented by PassManager objects that
-// is used to pull analysis information out of them.
-//
-struct AnalysisResolver {
- virtual ~AnalysisResolver();
- virtual Pass *getAnalysisOrNullUp(AnalysisID ID) const = 0;
- virtual Pass *getAnalysisOrNullDown(AnalysisID ID) const = 0;
- virtual void addPass(ImmutablePass *IP, AnalysisUsage &AU) = 0;
- Pass *getAnalysis(AnalysisID ID) const {
- Pass *Result = getAnalysisOrNullUp(ID);
- assert(Result && "Pass has an incorrect analysis uses set!");
- return Result;
- }
-
- // getAnalysisToUpdate - Return an analysis result or null if it doesn't exist
- Pass *getAnalysisToUpdate(AnalysisID ID) const {
- return getAnalysisOrNullUp(ID);
- }
-
- // Methods for introspecting into pass manager objects...
- virtual unsigned getDepth() const = 0;
- virtual unsigned getNumContainedPasses() const = 0;
- virtual const Pass *getContainedPass(unsigned N) const = 0;
-
- virtual void markPassUsed(AnalysisID P, Pass *User) = 0;
-
- void startPass(Pass *P) {}
- void endPass(Pass *P) {}
-};
-
/// getAnalysisToUpdate<AnalysisType>() - This function is used by subclasses
/// to get to the analysis information that might be around that needs to be
/// updated. This is different than getAnalysis in that it can fail (ie the
@@ -187,12 +156,12 @@ struct AnalysisResolver {
///
template<typename AnalysisType>
AnalysisType *Pass::getAnalysisToUpdate() const {
- assert(Resolver_New && "Pass not resident in a PassManager object!");
+ assert(Resolver && "Pass not resident in a PassManager object!");
const PassInfo *PI = getClassPassInfo<AnalysisType>();
if (PI == 0) return 0;
return dynamic_cast<AnalysisType*>
- (Resolver_New->getAnalysisToUpdate(PI, true));
+ (Resolver->getAnalysisToUpdate(PI, true));
}
/// getAnalysis<AnalysisType>() - This function is used by subclasses to get
@@ -201,7 +170,7 @@ AnalysisType *Pass::getAnalysisToUpdate() const {
///
template<typename AnalysisType>
AnalysisType &Pass::getAnalysis() const {
- assert(Resolver_New &&"Pass has not been inserted into a PassManager object!");
+ assert(Resolver &&"Pass has not been inserted into a PassManager object!");
return getAnalysisID<AnalysisType>(getClassPassInfo<AnalysisType>());
}
@@ -209,11 +178,11 @@ AnalysisType &Pass::getAnalysis() const {
template<typename AnalysisType>
AnalysisType &Pass::getAnalysisID(const PassInfo *PI) const {
assert(PI && "getAnalysis for unregistered pass!");
- assert(Resolver_New&&"Pass has not been inserted into a PassManager object!");
+ 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 = Resolver_New->findImplPass(PI);
+ Pass *ResultPass = Resolver->findImplPass(PI);
assert (ResultPass &&
"getAnalysis*() called on an analysis that was not "
"'required' by pass!");