[all-commits] [llvm/llvm-project] e130fb: [libc++] Some fixes to the <bit> utilities.

Quuxplusone via All-commits all-commits at lists.llvm.org
Tue May 18 16:57:07 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e130fbe24e5801feba4526ef5b190acbefba7d91
      https://github.com/llvm/llvm-project/commit/e130fbe24e5801feba4526ef5b190acbefba7d91
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2021-05-18 (Tue, 18 May 2021)

  Changed paths:
    M libcxx/include/bit
    M libcxx/include/type_traits
    M libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.pass.cpp
    M libcxx/test/std/numerics/bit/bit.pow.two/bit_floor.pass.cpp
    M libcxx/test/std/numerics/bit/bit.pow.two/bit_width.pass.cpp
    M libcxx/test/std/numerics/bit/bit.pow.two/has_single_bit.pass.cpp
    M libcxx/test/std/numerics/bit/bitops.count/countl_one.pass.cpp
    M libcxx/test/std/numerics/bit/bitops.count/countl_zero.pass.cpp
    M libcxx/test/std/numerics/bit/bitops.count/countr_one.pass.cpp
    M libcxx/test/std/numerics/bit/bitops.count/countr_zero.pass.cpp
    M libcxx/test/std/numerics/bit/bitops.count/popcount.pass.cpp
    M libcxx/test/std/numerics/bit/bitops.rot/rotl.pass.cpp
    M libcxx/test/std/numerics/bit/bitops.rot/rotr.pass.cpp

  Log Message:
  -----------
  [libc++] Some fixes to the <bit> utilities.

Fix __bitop_unsigned_integer and rename to __libcpp_is_unsigned_integer.
There are only five unsigned integer types, so we should just list them out.
Also provide `__libcpp_is_signed_integer`, even though the Standard doesn't
consume that trait anywhere yet.

Notice that `concept uniform_random_bit_generator` is specifically specified
to rely on `concept unsigned_integral` and *not* `__is_unsigned_integer`.
Instantiating `std::ranges::sample` with a type `U` satisfying
`uniform_random_bit_generator` where `unsigned_integral<U::result_type>`
and not `__is_unsigned_integer<U::result_type>` is simply IFNDR.

Orthogonally, fix an undefined behavior in std::countr_zero(__uint128_t).

Orthogonally, improve tests for the <bit> manipulation functions.
It was these new tests that detected the bug in countr_zero.

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


  Commit: 06b40e80aefc9a7ccf2efbf7717037bd103a779c
      https://github.com/llvm/llvm-project/commit/06b40e80aefc9a7ccf2efbf7717037bd103a779c
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2021-05-18 (Tue, 18 May 2021)

  Changed paths:
    M libcxx/include/__node_handle
    M libcxx/include/bit
    M libcxx/include/deque
    M libcxx/include/fstream
    M libcxx/include/functional
    M libcxx/include/future
    M libcxx/include/map
    M libcxx/include/numeric
    M libcxx/include/regex
    M libcxx/include/set
    M libcxx/include/span

  Log Message:
  -----------
  [libc++] Alphabetize header inclusions and include-what-you-use <__debug>. NFCI.


Compare: https://github.com/llvm/llvm-project/compare/a32e39a75b81...06b40e80aefc


More information about the All-commits mailing list