summaryrefslogtreecommitdiff
path: root/lib/Support/Debug.cpp
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
commit3c9509f82a8ddc04f233587397e6c0d787694fab (patch)
tree35caa46645a90d4986de81eee7dbe4b6c23bbd9f /lib/Support/Debug.cpp
parent31e7eba06fdd74d72501b82fbedfb9724346c2ce (diff)
downloadllvm-3c9509f82a8ddc04f233587397e6c0d787694fab.tar.gz
llvm-3c9509f82a8ddc04f233587397e6c0d787694fab.tar.bz2
llvm-3c9509f82a8ddc04f233587397e6c0d787694fab.tar.xz
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 'lib/Support/Debug.cpp')
-rw-r--r--lib/Support/Debug.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Support/Debug.cpp b/lib/Support/Debug.cpp
index a09cddf902..b6beddb369 100644
--- a/lib/Support/Debug.cpp
+++ b/lib/Support/Debug.cpp
@@ -64,6 +64,14 @@ bool llvm::isCurrentDebugType(const char *DebugType) {
#endif
}
+/// getNullOutputStream - Return a null string that does not output
+/// anything. This hides the static variable from other modules.
+///
+OStream &llvm::getNullOutputStream() {
+ static llvm::OStream NullStream(0);
+ return NullStream;
+}
+
// 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.