diff options
author | Nikita Popov <npopov@redhat.com> | 2023-05-31 10:16:16 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-05-31 17:13:48 +0200 |
commit | 42e98c6ae875e952ee852f78234c0f8ed311472b (patch) | |
tree | ddd9f121017663ab128330322e0737c5a3232a86 /llvm/lib/Support/APInt.cpp | |
parent | 3825910c7316cf62549bd31c503c48e7526adcc2 (diff) | |
download | llvm-42e98c6ae875e952ee852f78234c0f8ed311472b.zip llvm-42e98c6ae875e952ee852f78234c0f8ed311472b.tar.gz llvm-42e98c6ae875e952ee852f78234c0f8ed311472b.tar.bz2 |
[APInt] Support zero-width extract in extractBitsAsZExtValue()
D111241 added support for extractBits() with zero width. Extend this
to extractBitsAsZExtValue() as well for consistency (in which case
it will always return zero).
Differential Revision: https://reviews.llvm.org/D151788
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index bc27e9d..bd8358c 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -479,7 +479,6 @@ APInt APInt::extractBits(unsigned numBits, unsigned bitPosition) const { uint64_t APInt::extractBitsAsZExtValue(unsigned numBits, unsigned bitPosition) const { - assert(numBits > 0 && "Can't extract zero bits"); assert(bitPosition < BitWidth && (numBits + bitPosition) <= BitWidth && "Illegal bit extraction"); assert(numBits <= 64 && "Illegal bit extraction"); |