mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-13 23:18:58 +00:00
Remove unnecessary casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7250 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bfcdf14d83
commit
c8bf87af3e
@ -103,12 +103,12 @@ ChooseRegOrImmed(Value* val,
|
||||
if (isa<PointerType>(CPV->getType()))
|
||||
intValue = 0; // We checked above that it is NULL
|
||||
else if (ConstantBool* CB = dyn_cast<ConstantBool>(CPV))
|
||||
intValue = (int64_t) CB->getValue();
|
||||
intValue = CB->getValue();
|
||||
else if (CPV->getType()->isSigned())
|
||||
intValue = cast<ConstantSInt>(CPV)->getValue();
|
||||
else
|
||||
{ // get the int value and sign-extend if original was less than 64 bits
|
||||
intValue = (int64_t) cast<ConstantUInt>(CPV)->getValue();
|
||||
intValue = cast<ConstantUInt>(CPV)->getValue();
|
||||
switch(CPV->getType()->getPrimitiveID())
|
||||
{
|
||||
case Type::UByteTyID: intValue = (int64_t) (int8_t) intValue; break;
|
||||
|
@ -103,12 +103,12 @@ ChooseRegOrImmed(Value* val,
|
||||
if (isa<PointerType>(CPV->getType()))
|
||||
intValue = 0; // We checked above that it is NULL
|
||||
else if (ConstantBool* CB = dyn_cast<ConstantBool>(CPV))
|
||||
intValue = (int64_t) CB->getValue();
|
||||
intValue = CB->getValue();
|
||||
else if (CPV->getType()->isSigned())
|
||||
intValue = cast<ConstantSInt>(CPV)->getValue();
|
||||
else
|
||||
{ // get the int value and sign-extend if original was less than 64 bits
|
||||
intValue = (int64_t) cast<ConstantUInt>(CPV)->getValue();
|
||||
intValue = cast<ConstantUInt>(CPV)->getValue();
|
||||
switch(CPV->getType()->getPrimitiveID())
|
||||
{
|
||||
case Type::UByteTyID: intValue = (int64_t) (int8_t) intValue; break;
|
||||
|
Loading…
Reference in New Issue
Block a user