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

Devang Patel dpatel at apple.com
Wed Jan 17 12:30:36 PST 2007



Changes in directory llvm/lib/VMCore:

PassManager.cpp updated: 1.126 -> 1.127
---
Log message:

Update assignPassManager() signature to allow selection of preferred 
pass manager type. This allows new FPPassManager to select Call Graph
Pass Manager (if available) as its parent.


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

 PassManager.cpp |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)


Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.126 llvm/lib/VMCore/PassManager.cpp:1.127
--- llvm/lib/VMCore/PassManager.cpp:1.126	Tue Jan 16 16:38:10 2007
+++ llvm/lib/VMCore/PassManager.cpp	Wed Jan 17 14:30:17 2007
@@ -1202,7 +1202,8 @@
 
 /// Find appropriate Module Pass Manager in the PM Stack and
 /// add self into that manager. 
-void ModulePass::assignPassManager(PMStack &PMS) {
+void ModulePass::assignPassManager(PMStack &PMS, 
+				   PassManagerType PreferredType) {
 
   // Find Module Pass Manager
   while(!PMS.empty()) {
@@ -1219,7 +1220,8 @@
 
 /// Find appropriate Function Pass Manager or Call Graph Pass Manager
 /// in the PM Stack and add self into that manager. 
-void FunctionPass::assignPassManager(PMStack &PMS) {
+void FunctionPass::assignPassManager(PMStack &PMS,
+				     PassManagerType PreferredType) {
 
   // Find Module Pass Manager (TODO : Or Call Graph Pass Manager)
   while(!PMS.empty()) {
@@ -1245,7 +1247,13 @@
     // [3] Assign manager to manage this new manager. This may create
     // and push new managers into PMS
     Pass *P = dynamic_cast<Pass *>(FPP);
-    P->assignPassManager(PMS);
+
+    // If Call Graph Pass Manager is active then use it to manage
+    // this new Function Pass manager.
+    if (PMD->getPassManagerType() == PMT_CallGraphPassManager)
+      P->assignPassManager(PMS, PMT_CallGraphPassManager);
+    else
+      P->assignPassManager(PMS);
 
     // [4] Push new manager into PMS
     PMS.push(FPP);
@@ -1257,7 +1265,8 @@
 
 /// Find appropriate Basic Pass Manager or Call Graph Pass Manager
 /// in the PM Stack and add self into that manager. 
-void BasicBlockPass::assignPassManager(PMStack &PMS) {
+void BasicBlockPass::assignPassManager(PMStack &PMS,
+				       PassManagerType PreferredType) {
 
   BBPassManager *BBP = NULL;
 






More information about the llvm-commits mailing list