OSDN Git Service

[BitVector] Add find_[first,last]_[set,unset]_in.
authorZachary Turner <zturner@google.com>
Wed, 17 May 2017 15:49:45 +0000 (15:49 +0000)
committerZachary Turner <zturner@google.com>
Wed, 17 May 2017 15:49:45 +0000 (15:49 +0000)
commit66b46e1a8bba52798cca95e06fd1e9212ec061b4
treed4c0fb297f7e8c7cab2e81e94693ab48aa70f764
parentcc7e9046bde9558d5240665eb707121595c2a8e5
[BitVector] Add find_[first,last]_[set,unset]_in.

A lot of code is duplicated between the first_last and the
next / prev methods.  All of this code can be shared if they
are implemented in terms of find_first_in(Begin, End) etc,
in which case find_first = find_first_in(0, Size) and find_next
is find_first_in(Prev+1, Size), with similar reductions for
the other methods.

Differential Revision: https://reviews.llvm.org/D33104

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303269 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/BitVector.h
unittests/ADT/BitVectorTest.cpp