diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-28 15:32:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-28 15:32:19 +0000 |
commit | 337ba4f1060c186398363a037327b85fb8b4e1d1 (patch) | |
tree | 7b47449a0d64d0783adac61eb2a0c4a6aa764d97 /lib/Support/Debug.cpp | |
parent | 927dcecba16c04d82b567cbe00479256465bd5c2 (diff) | |
download | external_llvm-337ba4f1060c186398363a037327b85fb8b4e1d1.tar.gz external_llvm-337ba4f1060c186398363a037327b85fb8b4e1d1.tar.bz2 external_llvm-337ba4f1060c186398363a037327b85fb8b4e1d1.zip |
add a new 'SetCurrentDebugType' API (requested by Andrew Haley for JIT
stuff) to programmatically control the current debug flavor. While
I'm at it, doxygenate Debug.h and clean it up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Debug.cpp')
-rw-r--r-- | lib/Support/Debug.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Support/Debug.cpp b/lib/Support/Debug.cpp index 71ff411def..d4954b6e40 100644 --- a/lib/Support/Debug.cpp +++ b/lib/Support/Debug.cpp @@ -57,7 +57,18 @@ DebugOnly("debug-only", cl::desc("Enable a specific type of debug output"), bool llvm::isCurrentDebugType(const char *DebugType) { return CurrentDebugType.empty() || DebugType == CurrentDebugType; } + +/// SetCurrentDebugType - Set the current debug type, as if the -debug-only=X +/// option were specified. Note that DebugFlag also needs to be set to true for +/// debug output to be produced. +/// +void SetCurrentDebugType(const char *Type) { + CurrentDebugType = Type; +} + #else // Avoid "has no symbols" warning. +namespace llvm { int Debug_dummy = 0; +} #endif |