From c07736a397012499e337c994f7f952b07c709544 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 23 Jul 2003 15:22:26 +0000 Subject: Simplify code by using ConstantInt::getRawValue instead of checking to see whether the constant is signed or unsigned, then casting git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7252 91177308-0d34-0410-b5e6-96231b3b80d8 --- support/lib/Support/ConstantRange.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'support/lib') diff --git a/support/lib/Support/ConstantRange.cpp b/support/lib/Support/ConstantRange.cpp index b7ef5e0511..c9d8ae6fbb 100644 --- a/support/lib/Support/ConstantRange.cpp +++ b/support/lib/Support/ConstantRange.cpp @@ -126,10 +126,7 @@ uint64_t ConstantRange::getSetSize() const { // Simply subtract the bounds... Constant *Result = *(Constant*)Upper - *(Constant*)Lower; assert(Result && "Subtraction of constant integers not implemented?"); - if (getType()->isSigned()) - return (uint64_t)cast(Result)->getValue(); - else - return cast(Result)->getValue(); + return cast(Result)->getRawValue(); } -- cgit v1.2.3