[llvm-commits] [llvm] r41872 - /llvm/trunk/include/llvm/ADT/SparseBitVector.h
Daniel Berlin
dberlin at dberlin.org
Tue Sep 11 15:58:30 PDT 2007
Author: dannyb
Date: Tue Sep 11 17:58:27 2007
New Revision: 41872
URL: http://llvm.org/viewvc/llvm-project?rev=41872&view=rev
Log:
Move dump out of class, use "\n" instead of endl
Modified:
llvm/trunk/include/llvm/ADT/SparseBitVector.h
Modified: llvm/trunk/include/llvm/ADT/SparseBitVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SparseBitVector.h?rev=41872&r1=41871&r2=41872&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SparseBitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SparseBitVector.h Tue Sep 11 17:58:27 2007
@@ -796,16 +796,6 @@
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 @@
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";
+}
}
More information about the llvm-commits
mailing list