[all-commits] [llvm/llvm-project] 894ad2: Update {Small}BitVector size_type definition

Renato Golin via All-commits all-commits at lists.llvm.org
Thu Aug 19 03:13:54 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 894ad26bd55f91cbcfd12f5f54426efb859dc14d
      https://github.com/llvm/llvm-project/commit/894ad26bd55f91cbcfd12f5f54426efb859dc14d
  Author: Renato Golin <rengolin at systemcall.eu>
  Date:   2021-08-19 (Thu, 19 Aug 2021)

  Changed paths:
    M llvm/include/llvm/ADT/BitVector.h
    M llvm/include/llvm/ADT/SmallBitVector.h

  Log Message:
  -----------
  Update {Small}BitVector size_type definition

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 actually
`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.

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

Following directions from clang-tidy on case of variables.

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




More information about the All-commits mailing list