The previous implementation of LLVM Streams wasn't removing symbols. This
authorBill Wendling <isanbard@gmail.com>
Wed, 3 Jan 2007 22:37:27 +0000 (22:37 +0000)
committerBill Wendling <isanbard@gmail.com>
Wed, 3 Jan 2007 22:37:27 +0000 (22:37 +0000)
one should.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32845 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Debug.h
include/llvm/Support/Streams.h
lib/Support/Debug.cpp
lib/Support/Streams.cpp

index 627d088eb05e169cc184a2365bff49a009577f18..437e57ea0738cbed1641fc15cb4eaab609862129 100644 (file)
@@ -68,7 +68,7 @@ bool isCurrentDebugType(const char *Type);
 OStream &getErrorOutputStream(const char *DebugType);
 
 #ifdef NDEBUG
-#define DOUT cnull
+#define DOUT OStream(0)
 #else
 #define DOUT getErrorOutputStream(DEBUG_TYPE)
 #endif
index f141c92a9fe66cf1d39aafbce8593a72bdcdbc0b..4e1e4f3a26c84e2c9abe7efcff9b0fd6c6ca16c5 100644 (file)
@@ -39,11 +39,6 @@ namespace llvm {
       return *this;
     }
 
-//     inline BaseStream &operator << (std::ios &(*Func)(std::ios&)) {
-//       if (Stream) *Stream << Func;
-//       return *this;
-//     }
-      
     template <typename Ty>
     BaseStream &operator << (const Ty &Thing) {
       if (Stream) *Stream << Thing;
@@ -68,7 +63,6 @@ namespace llvm {
   typedef BaseStream<std::istream> IStream;
   typedef BaseStream<std::stringstream> StringStream;
 
-  extern OStream cnull;
   extern OStream cout;
   extern OStream cerr;
   extern IStream cin;
index 6e67ed8f6733c175442e4766921b100ef6fc9dd0..c5b6fa2bf443b0d79f0b637fe6ef8f9affc52771 100644 (file)
@@ -69,8 +69,9 @@ bool llvm::isCurrentDebugType(const char *DebugType) {
 // program from having to have hundreds of static c'tor/d'tors for them.
 // 
 OStream &llvm::getErrorOutputStream(const char *DebugType) {
+  static OStream cnoout(0);
   if (DebugFlag && isCurrentDebugType(DebugType))
     return cerr;
   else
-    return cnull;
+    return cnoout;
 }
index 3d20e9aea35ca845aca9d35dc44c1f07cb604a66..433f6b42418c16c2dfb651753ec569b5aea6eb50 100644 (file)
@@ -16,7 +16,6 @@
 #include <iostream>
 using namespace llvm;
 
-OStream llvm::cnull;
 OStream llvm::cout(std::cout);
 OStream llvm::cerr(std::cerr);
 IStream llvm::cin(std::cin);