summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit3178736d5052015a620c822cfd34a0a88d0200ac (patch)
tree5993d3f437a9454fb125e0b4f31dc7578231367e /llvm/lib/Support
parent476db10261f37e255d2aea40ed1473b7885796e8 (diff)
downloadbcm5719-llvm-3178736d5052015a620c822cfd34a0a88d0200ac.tar.gz
bcm5719-llvm-3178736d5052015a620c822cfd34a0a88d0200ac.zip
Using APInt more efficiently.
llvm-svn: 36475
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/ConstantRange.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Support/ConstantRange.cpp b/llvm/lib/Support/ConstantRange.cpp
index 71796493301..1e2a6375c45 100644
--- a/llvm/lib/Support/ConstantRange.cpp
+++ b/llvm/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,
OpenPOWER on IntegriCloud