mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 06:32:24 +00:00
APSInt: Simplify code to reduce the number of copies. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219586 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2b7b804fcc
commit
5defae6504
@ -269,19 +269,15 @@ public:
|
|||||||
else if (I2.getBitWidth() > I1.getBitWidth())
|
else if (I2.getBitWidth() > I1.getBitWidth())
|
||||||
return isSameValue(I1.extend(I2.getBitWidth()), I2);
|
return isSameValue(I1.extend(I2.getBitWidth()), I2);
|
||||||
|
|
||||||
// We have a signedness mismatch. Turn the signed value into an unsigned
|
assert(I1.isSigned() != I2.isSigned());
|
||||||
// value.
|
|
||||||
if (I1.isSigned()) {
|
|
||||||
if (I1.isNegative())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return APSInt(I1, true) == I2;
|
// We have a signedness mismatch. Check for negative values and do an
|
||||||
}
|
// unsigned compare if signs match.
|
||||||
|
if ((I1.isSigned() && I1.isNegative()) ||
|
||||||
if (I2.isNegative())
|
(!I1.isSigned() && I2.isNegative()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return I1 == APSInt(I2, true);
|
return I1.eq(I2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Profile - Used to insert APSInt objects, or objects that contain APSInt
|
/// Profile - Used to insert APSInt objects, or objects that contain APSInt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user