[PATCH] D108290: Update {Small}BitVector size_type definition

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 18 04:19:35 PDT 2021


rengolin created this revision.
rengolin added reviewers: aganea, serge-sans-paille.
Herald added a subscriber: dexonsmith.
rengolin requested review of this revision.
Herald added a project: LLVM.

SmallBitVector implements a level of indirection over BitVector by
storing a smaller bit-vector in a pointer-sized element, or in case the
number of elements exceeds the bucket size, it creates a new pointer to
a BitVector and uses that as its storage.

However, the functions returning the vector size were using `unsigned`,
which is ok for BitVector, but not for SmallBitVector, which is actially
`uintptr_t`.

This commit reuses the `size_type` definition to more than just `count`
and propagates them into range iteration, size calculation, etc.

This is a continuation of D108124 <https://reviews.llvm.org/D108124>.

I haven't changed all occurrences of `unsigned` or `uintptr_t` to
`size_type`, just those that were directly related.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108290

Files:
  llvm/include/llvm/ADT/BitVector.h
  llvm/include/llvm/ADT/SmallBitVector.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108290.367174.patch
Type: text/x-patch
Size: 6180 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210818/a7b7100a/attachment.bin>


More information about the llvm-commits mailing list