summaryrefslogtreecommitdiff
path: root/lib/Support
diff options
context:
space:
mode:
authorZhou Sheng <zhousheng00@gmail.com>2007-04-26 16:42:07 +0000
committerZhou Sheng <zhousheng00@gmail.com>2007-04-26 16:42:07 +0000
commitc125c00e68138b8ae7861b589277a491ee217893 (patch)
tree31b33ed7fa71edd1385327e2e78829b24cee1fc6 /lib/Support
parent2864b77efc986a5c80c262c753a8f9df0cf789ed (diff)
downloadllvm-c125c00e68138b8ae7861b589277a491ee217893.tar.gz
llvm-c125c00e68138b8ae7861b589277a491ee217893.tar.bz2
llvm-c125c00e68138b8ae7861b589277a491ee217893.tar.xz
Using APInt more efficiently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/ConstantRange.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp
index 7179649330..1e2a6375c4 100644
--- a/lib/Support/ConstantRange.cpp
+++ b/lib/Support/ConstantRange.cpp
@@ -44,22 +44,20 @@ ConstantRange::ConstantRange(const APInt &L, const APInt &U) :
Lower(L), Upper(U) {
assert(L.getBitWidth() == U.getBitWidth() &&
"ConstantRange with unequal bit widths");
- uint32_t BitWidth = L.getBitWidth();
- assert((L != U || (L == APInt::getMaxValue(BitWidth) ||
- L == APInt::getMinValue(BitWidth))) &&
+ assert((L != U || (L.isMaxValue() || L.isMinValue())) &&
"Lower == Upper, but they aren't min or max value!");
}
/// isFullSet - Return true if this set contains all of the elements possible
/// for this data-type
bool ConstantRange::isFullSet() const {
- return Lower == Upper && Lower == APInt::getMaxValue(getBitWidth());
+ return Lower == Upper && Lower.isMaxValue();
}
/// isEmptySet - Return true if this set contains no members.
///
bool ConstantRange::isEmptySet() const {
- return Lower == Upper && Lower == APInt::getMinValue(getBitWidth());
+ return Lower == Upper && Lower.isMinValue();
}
/// isWrappedSet - Return true if this set wraps around the top of the range,