aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-10-05 18:09:09 +0200
committerNikita Popov <nikita.ppv@gmail.com>2021-10-05 18:10:12 +0200
commit64eaffb613d0cb7fa7542fa48281a2e617ad8ee9 (patch)
tree019272d7328acdab72b56dd1c48742a062c610d0 /llvm/lib/Support/APInt.cpp
parent32ab79ebc496d73cb0eb3ad3b54d32b00fc49ba1 (diff)
downloadllvm-64eaffb613d0cb7fa7542fa48281a2e617ad8ee9.zip
llvm-64eaffb613d0cb7fa7542fa48281a2e617ad8ee9.tar.gz
llvm-64eaffb613d0cb7fa7542fa48281a2e617ad8ee9.tar.bz2
[APInt] Fix type limits warning (NFC)
Unsigned number is always >= 0.
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r--llvm/lib/Support/APInt.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 67ea57c..298dcf6 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -360,8 +360,7 @@ void APInt::flipBit(unsigned bitPosition) {
void APInt::insertBits(const APInt &subBits, unsigned bitPosition) {
unsigned subBitWidth = subBits.getBitWidth();
- assert(subBitWidth >= 0 && (subBitWidth + bitPosition) <= BitWidth &&
- "Illegal bit insertion");
+ assert((subBitWidth + bitPosition) <= BitWidth && "Illegal bit insertion");
// inserting no bits is a noop.
if (subBitWidth == 0)