[PATCH] D18578: Introduce BitSet: A BitVector based class behaving like std::set/DenseSet

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 11:50:33 PDT 2016


MatzeB added a comment.

In http://reviews.llvm.org/D18578#400148, @dblaikie wrote:

> This seems to have strange behavior - returning the size/empty status of
>  the BitVector for the BitSets operations is probably wrong, no? (the
>  BitVector's length is the length of the field, not the number of set (1)
>  bits in it)


BitSet::size() should return the number of elements in the set which corresponds to the number of set bits in the bitvector which should be BitVector::count().

empty() checks BitSet::size() against 0 which should be equivalent to BitVector::count() == 0.


Repository:
  rL LLVM

http://reviews.llvm.org/D18578





More information about the llvm-commits mailing list