summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorZhou Sheng <zhousheng00@gmail.com>2007-04-13 05:57:32 +0000
committerZhou Sheng <zhousheng00@gmail.com>2007-04-13 05:57:32 +0000
commit01c175ec52bba43b0347fc49fe7050ca4677d83a (patch)
treed9cd12009d46bb437829d7eb67e13421f0775082 /llvm/lib/Support
parente71f1447f79fe2d92eb7353cb25edca57856863e (diff)
downloadbcm5719-llvm-01c175ec52bba43b0347fc49fe7050ca4677d83a.tar.gz
bcm5719-llvm-01c175ec52bba43b0347fc49fe7050ca4677d83a.zip
Make the apint construction more effective.
llvm-svn: 35960
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/ConstantRange.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Support/ConstantRange.cpp b/llvm/lib/Support/ConstantRange.cpp
index 79a85b80d7e..71796493301 100644
--- a/llvm/lib/Support/ConstantRange.cpp
+++ b/llvm/lib/Support/ConstantRange.cpp
@@ -108,7 +108,7 @@ APInt ConstantRange::getUnsignedMin() const {
/// ConstantRange.
///
APInt ConstantRange::getSignedMax() const {
- APInt SignedMax = APInt::getSignedMaxValue(getBitWidth());
+ APInt SignedMax(APInt::getSignedMaxValue(getBitWidth()));
if (!isWrappedSet()) {
if (getLower().slt(getUpper() - 1))
return getUpper() - 1;
@@ -130,7 +130,7 @@ APInt ConstantRange::getSignedMax() const {
/// ConstantRange.
///
APInt ConstantRange::getSignedMin() const {
- APInt SignedMin = APInt::getSignedMinValue(getBitWidth());
+ APInt SignedMin(APInt::getSignedMinValue(getBitWidth()));
if (!isWrappedSet()) {
if (getLower().slt(getUpper() - 1))
return getLower();
@@ -370,7 +370,7 @@ ConstantRange ConstantRange::signExtend(uint32_t DstTySize) const {
ConstantRange ConstantRange::truncate(uint32_t DstTySize) const {
unsigned SrcTySize = getBitWidth();
assert(SrcTySize > DstTySize && "Not a value truncation");
- APInt Size = APInt::getMaxValue(DstTySize).zext(SrcTySize);
+ APInt Size(APInt::getLowBitsSet(SrcTySize, DstTySize));
if (isFullSet() || getSetSize().ugt(Size))
return ConstantRange(DstTySize);
OpenPOWER on IntegriCloud