From a3bba5ce20afba15722f806a8d17709ef13f698a Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Tue, 11 Sep 2007 22:58:27 +0000 Subject: [PATCH] Move dump out of class, use "\n" instead of endl llvm-svn: 41872 --- llvm/include/llvm/ADT/SparseBitVector.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/llvm/include/llvm/ADT/SparseBitVector.h b/llvm/include/llvm/ADT/SparseBitVector.h index 3a2fb1f234f7..cfa57f408f47 100644 --- a/llvm/include/llvm/ADT/SparseBitVector.h +++ b/llvm/include/llvm/ADT/SparseBitVector.h @@ -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 &LHS, const SparseBitVector *RHS) { return LHS &= (*RHS); } + + +// Dump a SparseBitVector to a stream +template +void dump(const SparseBitVector &LHS, llvm::OStream &out) { + out << "[ "; + + typename SparseBitVector::iterator bi; + for (bi = LHS.begin(); bi != LHS.end(); ++bi) { + out << *bi << " "; + } + out << "\n"; +} }