mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user