summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/SparseBitVector.h
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2007-09-11 22:58:27 +0000
committerDaniel Berlin <dberlin@dberlin.org>2007-09-11 22:58:27 +0000
commitec39cb98d38bc0474a9ba207bcee31718db0e178 (patch)
tree5a66a67214e9aaf4ded844af2a503bfbda23dc38 /include/llvm/ADT/SparseBitVector.h
parent6d6d352ed9bf69f06d8084b76042d7e9b3980cb5 (diff)
downloadllvm-ec39cb98d38bc0474a9ba207bcee31718db0e178.tar.gz
llvm-ec39cb98d38bc0474a9ba207bcee31718db0e178.tar.bz2
llvm-ec39cb98d38bc0474a9ba207bcee31718db0e178.tar.xz
Move dump out of class, use "\n" instead of endl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/SparseBitVector.h')
-rw-r--r--include/llvm/ADT/SparseBitVector.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/include/llvm/ADT/SparseBitVector.h b/include/llvm/ADT/SparseBitVector.h
index 3a2fb1f234..cfa57f408f 100644
--- a/include/llvm/ADT/SparseBitVector.h
+++ b/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<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";
+}
}