diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-01-12 04:24:46 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-01-12 04:24:46 +0000 |
commit | 579dca12c2cfd60bc18aaadbd5331897d48fec29 (patch) | |
tree | cb9cb81fdb02dedb8e6c391a9fd8763f9105b7cc /lib/Analysis/ConstantRange.cpp | |
parent | 53bfebc967c0a68023db8fe95f7319f8ab724998 (diff) |
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/Analysis/ConstantRange.cpp')
-rw-r--r-- | lib/Analysis/ConstantRange.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Analysis/ConstantRange.cpp b/lib/Analysis/ConstantRange.cpp index 6c2dce03aa..7a344201dd 100644 --- a/lib/Analysis/ConstantRange.cpp +++ b/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<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) { |