summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn Mosby <ojomojo@gmail.com>2010-05-22 05:13:17 +0000
committerJohn Mosby <ojomojo@gmail.com>2010-05-22 05:13:17 +0000
commit3422cf05a8a4817c6c525ef4d66026761ec590c1 (patch)
tree92543af19f7b3a51ed49a8eacd60f8e9dbbe5754 /include
parent2457f2c66184e978d4ed8fa9e2128effff26cb0b (diff)
downloadllvm-3422cf05a8a4817c6c525ef4d66026761ec590c1.tar.gz
llvm-3422cf05a8a4817c6c525ef4d66026761ec590c1.tar.bz2
llvm-3422cf05a8a4817c6c525ef4d66026761ec590c1.tar.xz
Trivial change to dump() function for SparseBitVector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104433 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/SparseBitVector.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/llvm/ADT/SparseBitVector.h b/include/llvm/ADT/SparseBitVector.h
index 6c813ecd36..0862981887 100644
--- a/include/llvm/ADT/SparseBitVector.h
+++ b/include/llvm/ADT/SparseBitVector.h
@@ -889,13 +889,17 @@ operator-(const SparseBitVector<ElementSize> &LHS,
// Dump a SparseBitVector to a stream
template <unsigned ElementSize>
void dump(const SparseBitVector<ElementSize> &LHS, raw_ostream &out) {
- out << "[ ";
-
- typename SparseBitVector<ElementSize>::iterator bi;
- for (bi = LHS.begin(); bi != LHS.end(); ++bi) {
- out << *bi << " ";
+ out << "[";
+
+ typename SparseBitVector<ElementSize>::iterator bi = LHS.begin(),
+ be = LHS.end();
+ if (bi != be) {
+ out << *bi;
+ for (++bi; bi != be; ++bi) {
+ out << " " << *bi;
+ }
}
- out << " ]\n";
+ out << "]\n";
}
} // end namespace llvm