Move dump out of class, use "\n" instead of endl
authorDaniel Berlin <dberlin@dberlin.org>
Tue, 11 Sep 2007 22:58:27 +0000 (22:58 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Tue, 11 Sep 2007 22:58:27 +0000 (22:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41872 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/SparseBitVector.h

index 3a2fb1f234f789d64e67cc72e4b59466ccbfd806..cfa57f408f47c22ee2292d369818157731ac4fc0 100644 (file)
@@ -796,16 +796,6 @@ public:
     return iterator(this, ~0);
   }
 
-  // Dump our bits to stderr
-  void dump(llvm::OStream &out) const {
-    out << "[ ";
-    for (iterator bi = begin();
-         bi != end();
-         ++bi) {
-      out << *bi << " ";
-    }
-    out << std::endl;
-  }
 };
 
 // Convenience functions to allow Or and And without dereferencing in the user
@@ -834,6 +824,19 @@ inline bool operator &=(SparseBitVector<ElementSize> &LHS,
                         const SparseBitVector<ElementSize> *RHS) {
   return LHS &= (*RHS);
 }
+
+// Dump a SparseBitVector to a stream
+template <unsigned ElementSize>
+void dump(const SparseBitVector<ElementSize> &LHS, llvm::OStream &out) {
+  out << "[ ";
+
+  typename SparseBitVector<ElementSize>::iterator bi;
+  for (bi = LHS.begin(); bi != LHS.end(); ++bi) {
+    out << *bi << " ";
+  }
+    out << "\n";
+}
 
 }