[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Devang Patel
dpatel at apple.com
Wed Dec 13 14:10:15 PST 2006
Changes in directory llvm/lib/VMCore:
PassManager.cpp updated: 1.96 -> 1.97
---
Log message:
Add -pass-debug=Arguments support in new manager.
---
Diffs of the changes: (+29 -1)
PassManager.cpp | 30 +++++++++++++++++++++++++++++-
1 files changed, 29 insertions(+), 1 deletion(-)
Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.96 llvm/lib/VMCore/PassManager.cpp:1.97
--- llvm/lib/VMCore/PassManager.cpp:1.96 Wed Dec 13 15:56:10 2006
+++ llvm/lib/VMCore/PassManager.cpp Wed Dec 13 16:10:00 2006
@@ -192,6 +192,7 @@
// Print passes managed by this top level manager.
void dumpPasses();
+ void dumpArguments();
private:
@@ -299,6 +300,18 @@
}
}
+ void dumpPassArguments() {
+ for(std::vector<Pass *>::iterator I = PassVector.begin(),
+ E = PassVector.end(); I != E; ++I) {
+ if (PMDataManager *PMD = dynamic_cast<PMDataManager *>(*I))
+ PMD->dumpPassArguments();
+ else
+ if (const PassInfo *PI = (*I)->getPassInfo())
+ if (!PI->isAnalysisGroup())
+ cerr << " -" << PI->getPassArgument();
+ }
+ }
+
protected:
// Collection of pass whose last user asked this manager to claim
@@ -360,7 +373,6 @@
dumpLastUses(*I, Offset+1);
}
}
-
};
//===----------------------------------------------------------------------===//
@@ -651,6 +663,21 @@
}
+void PMTopLevelManager::dumpArguments() {
+
+ if (PassDebugging_New < Arguments)
+ return;
+
+ cerr << "Pass Arguments: ";
+ for (std::vector<Pass *>::iterator I = PassManagers.begin(),
+ E = PassManagers.end(); I != E; ++I) {
+ PMDataManager *PMD = dynamic_cast<PMDataManager *>(*I);
+ assert(PMD && "This is not a PassManager");
+ PMD->dumpPassArguments();
+ }
+ cerr << "\n";
+}
+
//===----------------------------------------------------------------------===//
// PMDataManager implementation
@@ -1270,6 +1297,7 @@
bool Changed = false;
+ dumpArguments();
if (PassDebugging_New >= Structure)
dumpPasses();
More information about the llvm-commits
mailing list