[llvm-commits] CVS: llvm/include/llvm/ADT/BitSetVector.h

Bill Wendling isanbard at gmail.com
Sat Dec 16 21:15:53 PST 2006



Changes in directory llvm/include/llvm/ADT:

BitSetVector.h updated: 1.18 -> 1.19
---
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 -12)

 BitSetVector.h |   15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)


Index: llvm/include/llvm/ADT/BitSetVector.h
diff -u llvm/include/llvm/ADT/BitSetVector.h:1.18 llvm/include/llvm/ADT/BitSetVector.h:1.19
--- llvm/include/llvm/ADT/BitSetVector.h:1.18	Wed Dec  6 19:30:30 2006
+++ llvm/include/llvm/ADT/BitSetVector.h	Sat Dec 16 23:15:12 2006
@@ -27,7 +27,6 @@
 
 #include "llvm/Support/Streams.h"
 #include <bitset>
-#include <vector>
 #include <functional>
 
 namespace llvm {
@@ -173,10 +172,8 @@
   ///
   ///  Printing and debugging support
   ///
-  void print(OStream &O) const {
-    if (O.stream()) print(*O.stream());
-  }
   void print(std::ostream &O) const;
+  void print(std::ostream *O) const { if (O) print(*O); }
   void dump() const { print(cerr); }
 
 public:
@@ -247,24 +244,18 @@
 };
 
 
-inline void BitSetVector::print(std::ostream& O) const
+inline void BitSetVector::print(llvm_ostream& O) const
 {
   for (std::vector<bitword>::const_iterator
          I=bitsetVec.begin(), E=bitsetVec.end(); I != E; ++I)
     O << "<" << (*I) << ">" << (I+1 == E? "\n" : ", ");
 }
 
-inline OStream& operator<< (OStream& O, const BitSetVector& bset) {
-  bset.print(O);
-  return O;
-}
-inline std::ostream& operator<< (std::ostream& O, const BitSetVector& bset)
-{
+inline std::ostream& operator<<(std::ostream& O, const BitSetVector& bset) {
   bset.print(O);
   return O;
 }
 
-
 ///
 /// Optimized versions of fundamental comparison operations
 ///






More information about the llvm-commits mailing list