This change is needed to apply generic algorithmic functions (like in
STLExtras.h) to the result of SmallBitVector::set_bits
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
150 ms | linux > Polly.ScopInfo::memcpy-raw-source.ll |
Event Timeline
llvm/include/llvm/ADT/BitVector.h | ||
---|---|---|
36 | Looks like this isn't a forward iterator - it's an input iterator. A forward iterator requires: "The type std::iterator_traits<It>::reference must be exactly And that the return type of "op*" is referenec. Since the return type of op* is unsigned, this could be an input iterator. Or, I guess, the return type could be changed, since there is ongoing storage for the value (so long as the iterator isn't incremented - but that gets complicated with reverse iterators... ). |
I had an attempt here: https://reviews.llvm.org/D33419, I think similar concerns came up in that review.
Indeed it is not a forward iterator because it is bound to no object. I am changing it to an input iterator.
BitVector's iterator should be an input iterator instead of a forward iterator
because it is bound to no unsigned object
Indeed, sorry that fell through & I didn't understand enough about iterators to instead suggest falling back to an input iterator instead of figuring out how to fit the semantics of the forward iterator. Perhaps after this is committed you could resurrect your original patch to remove the op!= and maybe add the extra checks you were proposing to the facade?
Great, thanks!
clang-tidy: warning: invalid case style for class 'const_set_bits_iterator_impl' [readability-identifier-naming]
not useful