summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Debug.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-28 15:32:19 +0000
committerChris Lattner <sabre@nondot.org>2009-10-28 15:32:19 +0000
commitfbaac77c707cfeed186f28e0f3595db87c706a33 (patch)
treee2b80d2d3f4984681f1a77c91511d55f0a44c2c9 /llvm/lib/Support/Debug.cpp
parent14ca753e28414ae33e40759baf56cba17e778c9c (diff)
downloadbcm5719-llvm-fbaac77c707cfeed186f28e0f3595db87c706a33.tar.gz
bcm5719-llvm-fbaac77c707cfeed186f28e0f3595db87c706a33.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. llvm-svn: 85395
Diffstat (limited to 'llvm/lib/Support/Debug.cpp')
-rw-r--r--llvm/lib/Support/Debug.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Support/Debug.cpp b/llvm/lib/Support/Debug.cpp
index 71ff411def2..d4954b6e40b 100644
--- a/llvm/lib/Support/Debug.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud