aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/PassManagerT.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-07-30 16:27:02 +0000
committerChris Lattner <sabre@nondot.org>2002-07-30 16:27:02 +0000
commit37d66c4dea6330d0a5441f82b12b9b8add1e3684 (patch)
treee6a3777d7ec48bdb6802771e6675702e82c9eef1 /lib/VMCore/PassManagerT.h
parent5fa829c54a38f017fc1077c57716269275524e59 (diff)
downloadexternal_llvm-37d66c4dea6330d0a5441f82b12b9b8add1e3684.zip
external_llvm-37d66c4dea6330d0a5441f82b12b9b8add1e3684.tar.gz
external_llvm-37d66c4dea6330d0a5441f82b12b9b8add1e3684.tar.bz2
* Move some code from Pass.cpp to PassManagerT.h
* Implement stuff so that code can declare that they only depend on the CFG of a function, not on anything else. This speeds up GCCAS a lot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/PassManagerT.h')
-rw-r--r--lib/VMCore/PassManagerT.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/lib/VMCore/PassManagerT.h b/lib/VMCore/PassManagerT.h
index 6e5fcbd..555bcaa 100644
--- a/lib/VMCore/PassManagerT.h
+++ b/lib/VMCore/PassManagerT.h
@@ -16,11 +16,34 @@
#define LLVM_PASSMANAGER_T_H
#include "llvm/Pass.h"
-#include <string>
+#include "Support/CommandLine.h"
#include <algorithm>
class Annotable;
//===----------------------------------------------------------------------===//
+// 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.
+//
+
+// Different debug levels that can be enabled...
+enum PassDebugLevel {
+ None, Structure, Executions, Details
+};
+
+static cl::opt<enum PassDebugLevel>
+PassDebugging("debug-pass", cl::Hidden,
+ cl::desc("Print PassManager debugging information"),
+ cl::values(
+ clEnumVal(None , "disable debug output"),
+ // TODO: add option to print out pass names "PassOptions"
+ clEnumVal(Structure , "print pass structure before run()"),
+ clEnumVal(Executions, "print pass name before it is executed"),
+ clEnumVal(Details , "print pass details when it is executed"),
+ 0));
+
+//===----------------------------------------------------------------------===//
// PMDebug class - a set of debugging functions, that are not to be
// instantiated by the template.
//
@@ -28,7 +51,10 @@ struct PMDebug {
// If compiled in debug mode, these functions can be enabled by setting
// -debug-pass on the command line of the tool being used.
//
- static void PrintPassStructure(Pass *P);
+ static void PrintPassStructure(Pass *P) {
+ if (PassDebugging >= Structure)
+ P->dumpPassStructure();
+ }
static void PrintPassInformation(unsigned,const char*,Pass *, Annotable *);
static void PrintAnalysisSetInfo(unsigned,const char*,Pass *P,
const std::vector<AnalysisID> &);