<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 13, 2016 at 11:50 AM, Matthias Braun via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">MatzeB added a comment.<br>
<span class=""><br>
In <a href="http://reviews.llvm.org/D18578#400148" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18578#400148</a>, @dblaikie wrote:<br>
<br>
> This seems to have strange behavior - returning the size/empty status of<br>
>  the BitVector for the BitSets operations is probably wrong, no? (the<br>
>  BitVector's length is the length of the field, not the number of set (1)<br>
>  bits in it)<br>
<br>
<br>
</span>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().<br></blockquote><div><br></div><div>Ah, looks like you're right - my mistake.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">empty() checks BitSet::size() against 0 which should be equivalent to BitVector::count() == 0. </blockquote><div><br></div><div>Seems expensive, though - that makes empty O(N)?<br><br>(you might be able to simplify 'begin()' by sharing some of the implementation of "advance" - usually filtering iterators like this would call "advance" in their ctor, to search through to find the first relevant element (advance, then, would probably be designed to do nothing if the current element is valid - so ++ would have to increment the iterator, then call advance, rather than just calling advance))<br><br>My other general question is: Do we need both these abstractions (BitSet and BitVector) or should we just change BitVector into BitSet & check all the callers/users?<br><br>- Dave</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="im HOEnZb"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D18578" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18578</a><br>
<br>
<br>
<br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>