mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 14:35:54 +00:00
Hide the DOUT static variable behind a function interface.
llvm-svn: 76425
This commit is contained in:
parent
d5865e6c60
commit
5144b046cc
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user