Move dump out of class, use "\n" instead of endl

llvm-svn: 41872
This commit is contained in:
Daniel Berlin 2007-09-11 22:58:27 +00:00
parent c16847b157
commit a3bba5ce20
1 changed files with 13 additions and 10 deletions

View 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
@ -835,6 +825,19 @@ inline bool operator &=(SparseBitVector<ElementSize> &LHS,
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";
}
}
#endif