aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Pass.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-07-30 19:51:02 +0000
committerChris Lattner <sabre@nondot.org>2002-07-30 19:51:02 +0000
commit48c1bc7b3a7a0ee9b30da43b83f63f210c65ee91 (patch)
treedc3e707d626286e160088731f3b6ebc0633b09fa /lib/VMCore/Pass.cpp
parent55b45bfae3692c2a757f7c877e83b0b2e33a1247 (diff)
Implement new -debug-pass=Arguments option that causes PassManager to
print out the command line options for the optimizations it is running. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Pass.cpp')
-rw-r--r--lib/VMCore/Pass.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp
index d60a50053c..39766e3570 100644
--- a/lib/VMCore/Pass.cpp
+++ b/lib/VMCore/Pass.cpp
@@ -126,6 +126,19 @@ TimingInfo::~TimingInfo() {
}
+void PMDebug::PrintArgumentInformation(const Pass *P) {
+ // Print out passes in pass manager...
+ if (const AnalysisResolver *PM = dynamic_cast<const AnalysisResolver*>(P)) {
+ for (unsigned i = 0, e = PM->getNumContainedPasses(); i != e; ++i)
+ PrintArgumentInformation(PM->getContainedPass(i));
+
+ } else { // Normal pass. Print argument information...
+ // Print out arguments for registered passes that are _optimizations_
+ if (const PassInfo *PI = P->getPassInfo())
+ if (PI->getPassType() & PassInfo::Optimization)
+ std::cerr << " -" << PI->getPassArgument();
+ }
+}
void PMDebug::PrintPassInformation(unsigned Depth, const char *Action,
Pass *P, Annotable *V) {