mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-24 23:22:10 +00:00
[APInt] Use negate() instead of copying an APInt to negate it and then writing back over the original value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302770 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ada33d729b
commit
e74359195a
@ -1710,12 +1710,12 @@ void APInt::sdivrem(const APInt &LHS, const APInt &RHS,
|
||||
APInt::udivrem(-LHS, -RHS, Quotient, Remainder);
|
||||
else {
|
||||
APInt::udivrem(-LHS, RHS, Quotient, Remainder);
|
||||
Quotient = -Quotient;
|
||||
Quotient.negate();
|
||||
}
|
||||
Remainder = -Remainder;
|
||||
Remainder.negate();
|
||||
} else if (RHS.isNegative()) {
|
||||
APInt::udivrem(LHS, -RHS, Quotient, Remainder);
|
||||
Quotient = -Quotient;
|
||||
Quotient.negate();
|
||||
} else {
|
||||
APInt::udivrem(LHS, RHS, Quotient, Remainder);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user