aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/PassManager.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2006-12-13 20:03:48 +0000
committerDevang Patel <dpatel@apple.com>2006-12-13 20:03:48 +0000
commit45dc02d6f97447785ee7ffe08c36a34bc8921b0b (patch)
tree597178ed261e10f01592a41c65bb7ed1cced8194 /lib/VMCore/PassManager.cpp
parentf92b25ed4a2670ec9d4f5f746cf50ae337c0e0b8 (diff)
downloadexternal_llvm-45dc02d6f97447785ee7ffe08c36a34bc8921b0b.tar.gz
external_llvm-45dc02d6f97447785ee7ffe08c36a34bc8921b0b.tar.bz2
external_llvm-45dc02d6f97447785ee7ffe08c36a34bc8921b0b.zip
Move enum PassDebugLevel from PassManagerT.h to Pass.h.
Use PDL as the prefix for these enums. Define and use PassDebugging_New in new PassManager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32554 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/PassManager.cpp')
-rw-r--r--lib/VMCore/PassManager.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp
index d67d25a3f4..056a2a87c2 100644
--- a/lib/VMCore/PassManager.cpp
+++ b/lib/VMCore/PassManager.cpp
@@ -13,6 +13,7 @@
#include "llvm/PassManager.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Module.h"
#include "llvm/ModuleProvider.h"
#include "llvm/Support/Streams.h"
@@ -84,6 +85,27 @@ using namespace llvm;
// ModulePassManagers.
//===----------------------------------------------------------------------===//
+namespace llvm {
+
+//===----------------------------------------------------------------------===//
+// Pass debugging information. Often it is useful to find out what pass is
+// running when a crash occurs in a utility. When this library is compiled with
+// debugging on, a command line option (--debug-pass) is enabled that causes the
+// pass name to be printed before it executes.
+//
+
+static cl::opt<enum PassDebugLevel>
+PassDebugging_New("debug-pass", cl::Hidden,
+ cl::desc("Print PassManager debugging information"),
+ cl::values(
+ clEnumVal(PDLNone , "disable debug output"),
+ clEnumVal(PDLArguments , "print pass arguments to pass to 'opt'"),
+ clEnumVal(PDLStructure , "print pass structure before run()"),
+ clEnumVal(PDLExecutions, "print pass name before it is executed"),
+ clEnumVal(PDLDetails , "print pass details when it is executed"),
+ clEnumValEnd));
+} // End of llvm namespace
+
#ifndef USE_OLD_PASSMANAGER
namespace llvm {
@@ -1241,6 +1263,10 @@ bool PassManagerImpl_New::addPass(Pass *P) {
bool PassManagerImpl_New::run(Module &M) {
bool Changed = false;
+
+ if (PassDebugging_New >= PDLStructure)
+ dumpPasses();
+
for (std::vector<Pass *>::iterator I = passManagersBegin(),
E = passManagersEnd(); I != E; ++I) {
ModulePassManager *MP = dynamic_cast<ModulePassManager *>(*I);