[APInt] Fix isAllOnes and extractBits for zero width values.
authorChris Lattner <clattner@nondot.org>
Wed, 6 Oct 2021 16:53:50 +0000 (09:53 -0700)
committerChris Lattner <clattner@nondot.org>
Wed, 6 Oct 2021 19:37:53 +0000 (12:37 -0700)
commitad37a45a2e137fe05591f3fe7d23b5b921e7ff1d
tree9d5df793aa3e74721d73eb67bad5d23218f534af
parent8c08f21b6041d683b9466e463a5358c4d4fcac19
[APInt] Fix isAllOnes and extractBits for zero width values.

isAllOnes() should return true for zero bit values because
there are no zeros in it.

Thanks to Jay Foad for pointing this out.

Differential Revision: https://reviews.llvm.org/D111241
llvm/include/llvm/ADT/APInt.h
llvm/lib/Support/APInt.cpp
llvm/unittests/ADT/APIntTest.cpp