summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2006-12-08 23:53:00 +0000
committerDevang Patel <dpatel@apple.com>2006-12-08 23:53:00 +0000
commitd440cd92a5c908c9eb101f1671d291ea03626ccf (patch)
treea62f2284e3b53ed00c61b9f6358630deefc5a07d /llvm/lib
parent5fdac4070bf1a69fb737a14d8cce465a76ef7278 (diff)
downloadbcm5719-llvm-d440cd92a5c908c9eb101f1671d291ea03626ccf.tar.gz
bcm5719-llvm-d440cd92a5c908c9eb101f1671d291ea03626ccf.zip
Set AnalysisResolver for the passes when they are inserted into
pass manager queuer. llvm-svn: 32385
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/PassManager.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/PassManager.cpp b/llvm/lib/VMCore/PassManager.cpp
index 3fd2103007a..08249132228 100644
--- a/llvm/lib/VMCore/PassManager.cpp
+++ b/llvm/lib/VMCore/PassManager.cpp
@@ -393,6 +393,15 @@ public:
~FunctionPassManagerImpl_New() { /* TODO */ };
inline void addTopLevelPass(Pass *P) {
+
+ if (dynamic_cast<ImmutablePass *> (P)) {
+
+ // P is a immutable pass then it will be managed by this
+ // top level manager. Set up analysis resolver to connect them.
+ AnalysisResolver_New *AR = new AnalysisResolver_New(*this);
+ P->setResolver(AR);
+ }
+
addPass(P);
}
@@ -488,6 +497,15 @@ public:
}
inline void addTopLevelPass(Pass *P) {
+
+ if (dynamic_cast<ImmutablePass *> (P)) {
+
+ // P is a immutable pass and it will be managed by this
+ // top level manager. Set up analysis resolver to connect them.
+ AnalysisResolver_New *AR = new AnalysisResolver_New(*this);
+ P->setResolver(AR);
+ }
+
addPass(P);
}
@@ -577,6 +595,11 @@ void PMDataManager::removeDeadPasses(Pass *P) {
void PMDataManager::addPassToManager(Pass *P,
bool ProcessAnalysis) {
+ // This manager is going to manage pass P. Set up analysis resolver
+ // to connect them.
+ AnalysisResolver_New *AR = new AnalysisResolver_New(*this);
+ P->setResolver(AR);
+
if (ProcessAnalysis) {
// At the moment, this pass is the last user of all required passes.
@@ -1055,6 +1078,12 @@ bool PassManagerImpl_New::addPass(Pass *P) {
if (!activeManager || !activeManager->addPass(P)) {
activeManager = new ModulePassManager_New(getDepth() + 1);
+
+ // This top level manager is going to manage activeManager.
+ // Set up analysis resolver to connect them.
+ AnalysisResolver_New *AR = new AnalysisResolver_New(*this);
+ activeManager->setResolver(AR);
+
addPassManager(activeManager);
return activeManager->addPass(P);
}
OpenPOWER on IntegriCloud