[APInt] Add APInt::isOneBitSet helper.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 3 Jan 2023 16:10:06 +0000 (16:10 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 3 Jan 2023 16:10:29 +0000 (16:10 +0000)
commitad3e0e4b419461bbc56a79a33167e93141ba5859
tree154a66dfdcb761d2a183009f89270bfedaa9fb66
parente60b0d2a2227a3fa299884bc3388baecdd4c88e6
[APInt] Add APInt::isOneBitSet helper.

Equivalent tester for the APInt::getOneBitSet builder.

This should allow us to remove a number of cases where we're doing "Val == (1 << BitNo)" style code patterns.
llvm/include/llvm/ADT/APInt.h
llvm/unittests/ADT/APIntTest.cpp