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
This commit is contained in:
David Greene
2009-07-20 16:16:06 +00:00
parent 31e7eba06f
commit 3c9509f82a
2 changed files with 14 additions and 2 deletions

View File

@@ -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.