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

Devang Patel dpatel at apple.com
Fri Nov 10 17:10:36 PST 2006



Changes in directory llvm/lib/VMCore:

PassManager.cpp updated: 1.12 -> 1.13
---
Log message:

Keep track if analysis made available by the pass.


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

 PassManager.cpp |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)


Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.12 llvm/lib/VMCore/PassManager.cpp:1.13
--- llvm/lib/VMCore/PassManager.cpp:1.12	Fri Nov 10 18:42:16 2006
+++ llvm/lib/VMCore/PassManager.cpp	Fri Nov 10 19:10:19 2006
@@ -164,7 +164,7 @@
   return false;
 }
 
-/// Augment RequiredSet by adding analysis required by pass P.
+/// Augment RequiredAnalysis by adding analysis required by pass P.
 void CommonPassManagerImpl::noteDownRequiredAnalysis(Pass *P) {
   AnalysisUsage AnUsage;
   P->getAnalysisUsage(AnUsage);
@@ -174,6 +174,21 @@
   RequiredAnalysis.insert(RequiredAnalysis.end(), RequiredSet.begin(), RequiredSet.end());
 }
 
+/// Augement AvailableAnalysis by adding analysis made available by pass P.
+void CommonPassManagerImpl::noteDownAvailableAnalysis(Pass *P) {
+  
+  if (const PassInfo *PI = P->getPassInfo()) {
+    AvailableAnalysis.insert(PI);
+
+    //TODO This pass is the current implementation of all of the interfaces it
+    //TODO implements as well.
+    //TODO
+    //TODO const std::vector<const PassInfo*> &II = PI->getInterfacesImplemented();
+    //TODO for (unsigned i = 0, e = II.size(); i != e; ++i)
+    //TODO CurrentAnalyses[II[i]] = P;
+  }
+}
+
 /// Remove AnalysisID from the RequiredSet
 void CommonPassManagerImpl::removeAnalysis(AnalysisID AID) {
 
@@ -202,8 +217,9 @@
   if (!manageablePass(P))
     return false;
 
-  // Take a note of analysis required by this pass.
+  // Take a note of analysis required and made available by this pass
   noteDownRequiredAnalysis(P);
+  noteDownAvailableAnalysis(P);
 
   // Add pass
   PassVector.push_back(BP);
@@ -285,8 +301,9 @@
   if (!manageablePass(P))
     return false;
 
-  // Take a note of analysis required by this pass.
+  // Take a note of analysis required and made available by this pass
   noteDownRequiredAnalysis(P);
+  noteDownAvailableAnalysis(P);
 
   PassVector.push_back(FP);
   activeBBPassManager = NULL;
@@ -345,8 +362,9 @@
   if (!manageablePass(P))
     return false;
 
-  // Take a note of analysis required by this pass.
+  // Take a note of analysis required and made available by this pass
   noteDownRequiredAnalysis(P);
+  noteDownAvailableAnalysis(P);
 
   PassVector.push_back(MP);
   activeFunctionPassManager = NULL;






More information about the llvm-commits mailing list