summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/APInt.h
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-07-29 12:33:29 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-07-29 12:33:29 +0000
commita77b95a316e0eb04929c5d7fe96935124c3ed478 (patch)
treeea265c08eb17712e7784b241460f4b8f9093e78f /include/llvm/ADT/APInt.h
parente8b4a4a9d173d67e35e4b1d32e20140381db6bde (diff)
downloadllvm-a77b95a316e0eb04929c5d7fe96935124c3ed478.tar.gz
llvm-a77b95a316e0eb04929c5d7fe96935124c3ed478.tar.bz2
llvm-a77b95a316e0eb04929c5d7fe96935124c3ed478.tar.xz
APInt: Simplify code.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/APInt.h')
-rw-r--r--include/llvm/ADT/APInt.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h
index 9498ef031d..f30a6e3f08 100644
--- a/include/llvm/ADT/APInt.h
+++ b/include/llvm/ADT/APInt.h
@@ -357,13 +357,7 @@ public:
/// @brief Check if this APInt has an N-bits unsigned integer value.
bool isIntN(unsigned N) const {
assert(N && "N == 0 ???");
- if (N >= getBitWidth())
- return true;
-
- if (isSingleWord())
- return isUIntN(N, VAL);
- return APInt(N, makeArrayRef(pVal, getNumWords())).zext(getBitWidth())
- == (*this);
+ return getActiveBits() <= N;
}
/// @brief Check if this APInt has an N-bits signed integer value.