[llvm-commits] CVS: llvm/lib/Support/Debug.cpp Streams.cpp

2006-12-16 Thread Bill Wendling


Changes in directory llvm/lib/Support:

Debug.cpp updated: 1.10 -> 1.11
Streams.cpp updated: 1.2 -> 1.3
---
Log message:

Added an automatic cast to "std::ostream*" etc. from OStream. We then can
rework the hacks that had us passing OStream in. We pass in std::ostream*
instead, check for null, and then dispatch to the correct print() method.


---
Diffs of the changes:  (+3 -3)

 Debug.cpp   |4 ++--
 Streams.cpp |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/lib/Support/Debug.cpp
diff -u llvm/lib/Support/Debug.cpp:1.10 llvm/lib/Support/Debug.cpp:1.11
--- llvm/lib/Support/Debug.cpp:1.10 Wed Dec  6 19:30:31 2006
+++ llvm/lib/Support/Debug.cpp  Sat Dec 16 23:15:13 2006
@@ -68,9 +68,9 @@
 // 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.
 // 
-OStream llvm::getErrorOutputStream(const char *DebugType) {
+OStream &llvm::getErrorOutputStream(const char *DebugType) {
   if (DebugFlag && isCurrentDebugType(DebugType))
 return cerr;
   else
-return NullStream;
+return cnull;
 }


Index: llvm/lib/Support/Streams.cpp
diff -u llvm/lib/Support/Streams.cpp:1.2 llvm/lib/Support/Streams.cpp:1.3
--- llvm/lib/Support/Streams.cpp:1.2Wed Dec  6 19:30:31 2006
+++ llvm/lib/Support/Streams.cppSat Dec 16 23:15:13 2006
@@ -16,7 +16,7 @@
 #include 
 using namespace llvm;
 
-OStream llvm::NullStream;
+OStream llvm::cnull;
 OStream llvm::cout(std::cout);
 OStream llvm::cerr(std::cerr);
 IStream llvm::cin(std::cin);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Support/Debug.cpp Streams.cpp

2007-01-03 Thread Bill Wendling


Changes in directory llvm/lib/Support:

Debug.cpp updated: 1.11 -> 1.12
Streams.cpp updated: 1.3 -> 1.4
---
Log message:

The previous implementation of LLVM Streams wasn't removing symbols. This
one should.


---
Diffs of the changes:  (+2 -2)

 Debug.cpp   |3 ++-
 Streams.cpp |1 -
 2 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/Support/Debug.cpp
diff -u llvm/lib/Support/Debug.cpp:1.11 llvm/lib/Support/Debug.cpp:1.12
--- llvm/lib/Support/Debug.cpp:1.11 Sat Dec 16 23:15:13 2006
+++ llvm/lib/Support/Debug.cpp  Wed Jan  3 16:37:27 2007
@@ -69,8 +69,9 @@
 // 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: llvm/lib/Support/Streams.cpp
diff -u llvm/lib/Support/Streams.cpp:1.3 llvm/lib/Support/Streams.cpp:1.4
--- llvm/lib/Support/Streams.cpp:1.3Sat Dec 16 23:15:13 2006
+++ llvm/lib/Support/Streams.cppWed Jan  3 16:37:27 2007
@@ -16,7 +16,6 @@
 #include 
 using namespace llvm;
 
-OStream llvm::cnull;
 OStream llvm::cout(std::cout);
 OStream llvm::cerr(std::cerr);
 IStream llvm::cin(std::cin);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits