From dc48f203cdc5a0b8f79d28bab6219161061fd73b Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 7 Dec 2006 19:54:15 +0000 Subject: [PATCH] Add a handle to the top level pass manager in PMDataManager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32317 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/PassManager.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index bf306e9d5c8..0dff67f2720 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -160,7 +160,8 @@ void PMTopLevelManager::collectLastUses(std::vector &LastUses, LastUses.push_back(LUI->first); } - +//===----------------------------------------------------------------------===// +// PMDataManager /// PMDataManager provides the common place to manage the analysis data /// used by pass managers. @@ -168,6 +169,10 @@ class PMDataManager { public: + PMDataManager() : TPM(NULL) { + initializeAnalysisInfo(); + } + /// Return true IFF pass P's required analysis set does not required new /// manager. bool manageablePass(Pass *P); @@ -222,6 +227,10 @@ public: // TODO : Check if pass P is available. } + // Access toplevel manager + PMTopLevelManager *getTopLevelManager() { return TPM; } + void setTopLevelManager(PMTopLevelManager *T) { TPM = T; } + private: // Set of available Analysis. This information is used while scheduling // pass. If a pass requires an analysis which is not not available then @@ -235,6 +244,10 @@ private: // Collection of pass that are managed by this manager std::vector PassVector; + + // Top level manager. + // TODO : Make it a reference. + PMTopLevelManager *TPM; }; /// BasicBlockPassManager_New manages BasicBlockPass. It batches all the