From 6077c3195f74b27b75ed3e9df3af7a13798b437f 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 llvm-svn: 7252 --- llvm/support/lib/Support/ConstantRange.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'llvm/support/lib/Support/ConstantRange.cpp') diff --git a/llvm/support/lib/Support/ConstantRange.cpp b/llvm/support/lib/Support/ConstantRange.cpp index b7ef5e05110..c9d8ae6fbbc 100644 --- a/llvm/support/lib/Support/ConstantRange.cpp +++ b/llvm/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