From cddc9dfe975c3152a2db955b24cb6b4ee457e571 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Fri, 12 Jan 2007 04:24:46 +0000 Subject: 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. llvm-svn: 33110 --- llvm/lib/Analysis/ConstantRange.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Analysis/ConstantRange.cpp') diff --git a/llvm/lib/Analysis/ConstantRange.cpp b/llvm/lib/Analysis/ConstantRange.cpp index 6c2dce03aa5..7a344201dd3 100644 --- a/llvm/lib/Analysis/ConstantRange.cpp +++ b/llvm/lib/Analysis/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(C) && "Constant folding of integrals not impl??"); - return cast(C)->getBoolValue(); + return cast(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(C) && "Constant folding of integrals not impl??"); - return cast(C)->getBoolValue(); + return cast(C)->getZExtValue(); } static bool GT(ConstantInt *A, ConstantInt *B, bool isSigned) { -- cgit v1.2.3