aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/Debug.h
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-07-20 16:16:06 +0000
committerDavid Greene <greened@obbligato.org>2009-07-20 16:16:06 +0000
commite628e056c4737e43812fbbef4d9e78508eeb5a5a (patch)
tree35caa46645a90d4986de81eee7dbe4b6c23bbd9f /include/llvm/Support/Debug.h
parent3ac0d98f57e61a18c6af9265b0533f61ae9ede5f (diff)
downloadexternal_llvm-e628e056c4737e43812fbbef4d9e78508eeb5a5a.zip
external_llvm-e628e056c4737e43812fbbef4d9e78508eeb5a5a.tar.gz
external_llvm-e628e056c4737e43812fbbef4d9e78508eeb5a5a.tar.bz2
Hide the DOUT static variable behind a function interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76425 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Debug.h')
-rw-r--r--include/llvm/Support/Debug.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/llvm/Support/Debug.h b/include/llvm/Support/Debug.h
index 0ebed20..489a076 100644
--- a/include/llvm/Support/Debug.h
+++ b/include/llvm/Support/Debug.h
@@ -61,6 +61,11 @@ bool isCurrentDebugType(const char *Type);
do { if (DebugFlag && isCurrentDebugType(DEBUG_TYPE)) { X; } } while (0)
#endif
+/// getNullOutputStream - Return a null string that does not output
+/// anything. This hides the static variable from other modules.
+///
+OStream &getNullOutputStream();
+
/// getErrorOutputStream - Returns the error output stream (std::cerr). This
/// places the std::c* I/O streams into one .cpp file and relieves the whole
/// program from having to have hundreds of static c'tor/d'tors for them.
@@ -68,8 +73,7 @@ bool isCurrentDebugType(const char *Type);
OStream &getErrorOutputStream(const char *DebugType);
#ifdef NDEBUG
-static llvm::OStream NullStream(0);
-#define DOUT llvm::NullStream
+#define DOUT llvm::getNullOutputStream()
#else
#define DOUT llvm::getErrorOutputStream(DEBUG_TYPE)
#endif