[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Devang Patel
dpatel at apple.com
Wed Dec 13 16:25:21 PST 2006
Changes in directory llvm/lib/VMCore:
PassManager.cpp updated: 1.99 -> 1.100
---
Log message:
Add debug-pass=Details support to print Required and Preserved Set info.
---
Diffs of the changes: (+26 -1)
PassManager.cpp | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletion(-)
Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.99 llvm/lib/VMCore/PassManager.cpp:1.100
--- llvm/lib/VMCore/PassManager.cpp:1.99 Wed Dec 13 18:08:04 2006
+++ llvm/lib/VMCore/PassManager.cpp Wed Dec 13 18:25:06 2006
@@ -321,6 +321,17 @@
cerr << Msg2;
}
+ void dumpAnalysisSetInfo(const char *Msg, Pass *P,
+ const std::vector<AnalysisID> &Set) {
+ if (PassDebugging_New >= Details && !Set.empty()) {
+ cerr << (void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:";
+ for (unsigned i = 0; i != Set.size(); ++i) {
+ if (i) cerr << ",";
+ cerr << " " << Set[i]->getPassName();
+ }
+ cerr << "\n";
+ }
+ }
protected:
// Collection of pass whose last user asked this manager to claim
@@ -925,8 +936,13 @@
for (std::vector<Pass *>::iterator itr = passVectorBegin(),
e = passVectorEnd(); itr != e; ++itr) {
Pass *P = *itr;
+ AnalysisUsage AnUsage;
+ P->getAnalysisUsage(AnUsage);
+
std::string Msg2 = "' on BasicBlock '" + (*I).getName() + "'...\n";
dumpPassInfo(P, Msg1, Msg2);
+ dumpAnalysisSetInfo("Required", P, AnUsage.getRequiredSet());
+
initializeAnalysisImpl(P);
BasicBlockPass *BP = dynamic_cast<BasicBlockPass*>(P);
@@ -934,6 +950,7 @@
if (Changed)
dumpPassInfo(P, Msg3, Msg2);
+ dumpAnalysisSetInfo("Preserved", P, AnUsage.getPreservedSet());
removeNotPreservedAnalysis(P);
recordAvailableAnalysis(P);
@@ -1154,9 +1171,12 @@
for (std::vector<Pass *>::iterator itr = passVectorBegin(),
e = passVectorEnd(); itr != e; ++itr) {
Pass *P = *itr;
+ AnalysisUsage AnUsage;
+ P->getAnalysisUsage(AnUsage);
std::string Msg2 = "' on Function '" + F.getName() + "'...\n";
dumpPassInfo(P, Msg1, Msg2);
+ dumpAnalysisSetInfo("Required", P, AnUsage.getRequiredSet());
initializeAnalysisImpl(P);
FunctionPass *FP = dynamic_cast<FunctionPass*>(P);
@@ -1164,6 +1184,7 @@
if (Changed)
dumpPassInfo(P, Msg3, Msg2);
+ dumpAnalysisSetInfo("Preserved", P, AnUsage.getPreservedSet());
removeNotPreservedAnalysis(P);
recordAvailableAnalysis(P);
@@ -1294,9 +1315,12 @@
for (std::vector<Pass *>::iterator itr = passVectorBegin(),
e = passVectorEnd(); itr != e; ++itr) {
Pass *P = *itr;
+ AnalysisUsage AnUsage;
+ P->getAnalysisUsage(AnUsage);
std::string Msg2 = "' on Module '" + M.getModuleIdentifier() + "'...\n";
dumpPassInfo(P, Msg1, Msg2);
+ dumpAnalysisSetInfo("Required", P, AnUsage.getRequiredSet());
initializeAnalysisImpl(P);
ModulePass *MP = dynamic_cast<ModulePass*>(P);
@@ -1304,7 +1328,8 @@
if (Changed)
dumpPassInfo(P, Msg3, Msg2);
-
+ dumpAnalysisSetInfo("Preserved", P, AnUsage.getPreservedSet());
+
removeNotPreservedAnalysis(P);
recordAvailableAnalysis(P);
removeDeadPasses(P, Msg2);
More information about the llvm-commits
mailing list