[PATCH] D144165: [ADT] Provide C++20-style bit functions

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 00:13:32 PST 2023


kazu created this revision.
Herald added a project: All.
kazu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Tihs patches adds APInt::count{l,r}_{zero,one} and APInt::popcount to
be consistent with those functions in ADT/bit.h.

Once this patch lands, I'll take care of migration.

For now, I am intentionally leaving isPowerOf2 as is.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144165

Files:
  llvm/include/llvm/ADT/APInt.h
  llvm/unittests/ADT/APIntTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144165.497906.patch
Type: text/x-patch
Size: 40796 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230216/2dbee7da/attachment.bin>


More information about the llvm-commits mailing list