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

Devang Patel dpatel at apple.com
Wed Jan 17 13:19:39 PST 2007



Changes in directory llvm/lib/VMCore:

PassManager.cpp updated: 1.128 -> 1.129
---
Log message:

Update ModulePass::assignPassManager() to take into account Preferred 
Pass Manager Type.


---
Diffs of the changes:  (+5 -4)

 PassManager.cpp |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)


Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.128 llvm/lib/VMCore/PassManager.cpp:1.129
--- llvm/lib/VMCore/PassManager.cpp:1.128	Wed Jan 17 14:33:36 2007
+++ llvm/lib/VMCore/PassManager.cpp	Wed Jan 17 15:19:23 2007
@@ -1207,15 +1207,16 @@
 
   // Find Module Pass Manager
   while(!PMS.empty()) {
-    if (PMS.top()->getPassManagerType() > PMT_ModulePassManager)
+    PassManagerType TopPMType = PMS.top()->getPassManagerType();
+    if (TopPMType == PreferredType)
+      break; // We found desired pass manager
+    else if (TopPMType > PMT_ModulePassManager)
       PMS.pop();    // Pop children pass managers
     else
       break;
   }
-  MPPassManager *MPP = dynamic_cast<MPPassManager *>(PMS.top());
 
-  assert(MPP && "Unable to find Module Pass Manager");
-  MPP->add(this);
+  PMS.top()->add(this);
 }
 
 /// Find appropriate Function Pass Manager or Call Graph Pass Manager






More information about the llvm-commits mailing list