[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Devang Patel
dpatel at apple.com
Thu Dec 7 15:05:59 PST 2006
Changes in directory llvm/lib/VMCore:
PassManager.cpp updated: 1.54 -> 1.55
---
Log message:
New method, PMDataManager::collectRequiredAnalysisPasses()
---
Diffs of the changes: (+27 -7)
PassManager.cpp | 34 +++++++++++++++++++++++++++-------
1 files changed, 27 insertions(+), 7 deletions(-)
Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.54 llvm/lib/VMCore/PassManager.cpp:1.55
--- llvm/lib/VMCore/PassManager.cpp:1.54 Thu Dec 7 16:34:21 2006
+++ llvm/lib/VMCore/PassManager.cpp Thu Dec 7 17:05:44 2006
@@ -241,7 +241,7 @@
/// AvailableAnalysis appropriately if ProcessAnalysis is true.
void addPassToManager (Pass *P, bool ProcessAnalysis = true);
- // Initialize available analysis information.
+ /// Initialize available analysis information.
void initializeAnalysisInfo() {
AvailableAnalysis.clear();
@@ -252,12 +252,16 @@
recordAvailableAnalysis(*I);
}
- // All Required analyses should be available to the pass as it runs! Here
- // we fill in the AnalysisImpls member of the pass so that it can
- // successfully use the getAnalysis() method to retrieve the
- // implementations it needs.
- //
- void initializeAnalysisImpl(Pass *P);
+ /// Populate RequiredPasses with the analysis pass that are required by
+ /// pass P.
+ void collectRequiredAnalysisPasses(std::vector<Pass *> &RequiredPasses,
+ Pass *P);
+
+ /// All Required analyses should be available to the pass as it runs! Here
+ /// we fill in the AnalysisImpls member of the pass so that it can
+ /// successfully use the getAnalysis() method to retrieve the
+ /// implementations it needs.
+ void initializeAnalysisImpl(Pass *P);
inline std::vector<Pass *>::iterator passVectorBegin() {
return PassVector.begin();
@@ -520,6 +524,22 @@
PassVector.push_back(P);
}
+/// Populate RequiredPasses with the analysis pass that are required by
+/// pass P.
+void PMDataManager::collectRequiredAnalysisPasses(std::vector<Pass *> &RP,
+ Pass *P) {
+ AnalysisUsage AnUsage;
+ P->getAnalysisUsage(AnUsage);
+ const std::vector<AnalysisID> &RequiredSet = AnUsage.getRequiredSet();
+ for (std::vector<AnalysisID>::const_iterator
+ I = RequiredSet.begin(), E = RequiredSet.end();
+ I != E; ++I) {
+ Pass *AnalysisPass = NULL; //FIXME findAnalysisPass(*I,true);
+ assert (AnalysisPass && "Analysis pass is not available");
+ RP.push_back(AnalysisPass);
+ }
+}
+
// All Required analyses should be available to the pass as it runs! Here
// we fill in the AnalysisImpls member of the pass so that it can
// successfully use the getAnalysis() method to retrieve the
More information about the llvm-commits
mailing list