aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/ConstantRange.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-12 04:24:46 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-12 04:24:46 +0000
commit579dca12c2cfd60bc18aaadbd5331897d48fec29 (patch)
treecb9cb81fdb02dedb8e6c391a9fd8763f9105b7cc /lib/Support/ConstantRange.cpp
parent53bfebc967c0a68023db8fe95f7319f8ab724998 (diff)
downloadexternal_llvm-579dca12c2cfd60bc18aaadbd5331897d48fec29.zip
external_llvm-579dca12c2cfd60bc18aaadbd5331897d48fec29.tar.gz
external_llvm-579dca12c2cfd60bc18aaadbd5331897d48fec29.tar.bz2
Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that get(bool) be replaced by get(const Type*, uint64_t). This implements those changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33110 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/ConstantRange.cpp')
-rw-r--r--lib/Support/ConstantRange.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp
index 6c2dce0..7a34420 100644
--- a/lib/Support/ConstantRange.cpp
+++ b/lib/Support/ConstantRange.cpp
@@ -64,7 +64,7 @@ static ConstantInt *getMinValue(const Type *Ty, bool isSigned = false) {
}
static ConstantInt *Next(ConstantInt *CI) {
if (CI->getType() == Type::Int1Ty)
- return ConstantInt::get(!CI->getBoolValue());
+ return ConstantInt::get(Type::Int1Ty, !CI->getZExtValue());
Constant *Result = ConstantExpr::getAdd(CI,
ConstantInt::get(CI->getType(), 1));
@@ -75,14 +75,14 @@ static bool LT(ConstantInt *A, ConstantInt *B, bool isSigned) {
Constant *C = ConstantExpr::getICmp(
(isSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT), A, B);
assert(isa<ConstantInt>(C) && "Constant folding of integrals not impl??");
- return cast<ConstantInt>(C)->getBoolValue();
+ return cast<ConstantInt>(C)->getZExtValue();
}
static bool LTE(ConstantInt *A, ConstantInt *B, bool isSigned) {
Constant *C = ConstantExpr::getICmp(
(isSigned ? ICmpInst::ICMP_SLE : ICmpInst::ICMP_ULE), A, B);
assert(isa<ConstantInt>(C) && "Constant folding of integrals not impl??");
- return cast<ConstantInt>(C)->getBoolValue();
+ return cast<ConstantInt>(C)->getZExtValue();
}
static bool GT(ConstantInt *A, ConstantInt *B, bool isSigned) {