[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp

Devang Patel dpatel at apple.com
Fri Dec 8 15:53:15 PST 2006



Changes in directory llvm/lib/VMCore:

PassManager.cpp updated: 1.70 -> 1.71
---
Log message:

Set AnalysisResolver for the passes when they are inserted into
pass manager queuer.


---
Diffs of the changes:  (+29 -0)

 PassManager.cpp |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+)


Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.70 llvm/lib/VMCore/PassManager.cpp:1.71
--- llvm/lib/VMCore/PassManager.cpp:1.70	Fri Dec  8 17:28:54 2006
+++ llvm/lib/VMCore/PassManager.cpp	Fri Dec  8 17:53:00 2006
@@ -393,6 +393,15 @@
   ~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 @@
   }
 
   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::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 @@
 
   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);
   }






More information about the llvm-commits mailing list