diff options
author | Chris Lattner <sabre@nondot.org> | 2003-07-23 15:22:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-07-23 15:22:26 +0000 |
commit | 6077c3195f74b27b75ed3e9df3af7a13798b437f (patch) | |
tree | 48a5a2e54b7d1a5762d782e838db817d8a2e78ca /llvm/lib/Support/ConstantRange.cpp | |
parent | 79f22fe02fe354c50fc4d6a1c08a894fdd847dba (diff) | |
download | bcm5719-llvm-6077c3195f74b27b75ed3e9df3af7a13798b437f.tar.gz bcm5719-llvm-6077c3195f74b27b75ed3e9df3af7a13798b437f.zip |
Simplify code by using ConstantInt::getRawValue instead of checking to see
whether the constant is signed or unsigned, then casting
llvm-svn: 7252
Diffstat (limited to 'llvm/lib/Support/ConstantRange.cpp')
-rw-r--r-- | llvm/lib/Support/ConstantRange.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Support/ConstantRange.cpp b/llvm/lib/Support/ConstantRange.cpp index b7ef5e05110..c9d8ae6fbbc 100644 --- a/llvm/lib/Support/ConstantRange.cpp +++ b/llvm/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<ConstantSInt>(Result)->getValue(); - else - return cast<ConstantUInt>(Result)->getValue(); + return cast<ConstantInt>(Result)->getRawValue(); } |