aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/PassAnalysisSupport.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2006-12-08 23:28:54 +0000
committerDevang Patel <dpatel@apple.com>2006-12-08 23:28:54 +0000
commitf3dc6d9f95d4ba7756105154df4a8075bbbcf931 (patch)
tree491719071ea596fc2545b374fd2a895fe35f56d4 /include/llvm/PassAnalysisSupport.h
parent591b1b7526ed9c099de23cc995853a250c20502f (diff)
downloadexternal_llvm-f3dc6d9f95d4ba7756105154df4a8075bbbcf931.zip
external_llvm-f3dc6d9f95d4ba7756105154df4a8075bbbcf931.tar.gz
external_llvm-f3dc6d9f95d4ba7756105154df4a8075bbbcf931.tar.bz2
Add AnalysisResolver_New. It is a replacement for existing
AnalysisResolver. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32383 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/PassAnalysisSupport.h')
-rw-r--r--include/llvm/PassAnalysisSupport.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/include/llvm/PassAnalysisSupport.h b/include/llvm/PassAnalysisSupport.h
index 892d203..3ef43fd 100644
--- a/include/llvm/PassAnalysisSupport.h
+++ b/include/llvm/PassAnalysisSupport.h
@@ -100,7 +100,51 @@ public:
const std::vector<AnalysisID> &getPreservedSet() const { return Preserved; }
};
+//===----------------------------------------------------------------------===//
+// AnalysisResolver - Simple interface used by Pass objects to pull all
+// analysis information out of pass manager that is responsible to manage
+// the pass.
+//
+class PMDataManager;
+class AnalysisResolver_New {
+private:
+ AnalysisResolver_New(); // DO NOT IMPLEMENT
+
+public:
+ AnalysisResolver_New(PMDataManager &P) : PM(P) { }
+
+ inline PMDataManager &getPMDataManager() { return PM; }
+
+ // Find pass that is implementing PI.
+ Pass *findImplPass(const PassInfo *PI) {
+ Pass *ResultPass = 0;
+ for (unsigned i = 0; i < AnalysisImpls.size() ; ++i) {
+ if (AnalysisImpls[i].first == PI) {
+ ResultPass = AnalysisImpls[i].second;
+ break;
+ }
+ }
+ return ResultPass;
+ }
+ void addAnalysisImplsPair(const PassInfo *PI, Pass *P) {
+ std::pair<const PassInfo*, Pass*> pir = std::make_pair(PI,P);
+ AnalysisImpls.push_back(pir);
+ }
+
+ // getAnalysisToUpdate - Return an analysis result or null if it doesn't exist
+ Pass *getAnalysisToUpdate(AnalysisID ID, bool Direction) const;
+
+ // 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
+ // replaces AnalysisResolver
+ std::vector<std::pair<const PassInfo*, Pass*> > AnalysisImpls;
+
+private:
+ // PassManager that is used to resolve analysis info
+ PMDataManager &PM;
+};
//===----------------------------------------------------------------------===//
// AnalysisResolver - Simple interface implemented by PassManager objects that