summaryrefslogtreecommitdiff
path: root/lib/Analysis/ConstantRange.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-07-23 15:22:26 +0000
committerChris Lattner <sabre@nondot.org>2003-07-23 15:22:26 +0000
commitc07736a397012499e337c994f7f952b07c709544 (patch)
treee7ff1fb8eee2ca15a8f6edd4e537aecf7fe6be56 /lib/Analysis/ConstantRange.cpp
parentc8bf87af3efe766440d0df259a038a0b6998e6e9 (diff)
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
Diffstat (limited to 'lib/Analysis/ConstantRange.cpp')
-rw-r--r--lib/Analysis/ConstantRange.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/Analysis/ConstantRange.cpp b/lib/Analysis/ConstantRange.cpp
index b7ef5e05110..c9d8ae6fbbc 100644
--- a/lib/Analysis/ConstantRange.cpp
+++ b/lib/Analysis/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();
}