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
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 *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 @@
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) {