forked from OSchip/llvm-project
[APInt] Use negate() instead of copying an APInt to negate it and then writing back over the original value.
llvm-svn: 302770
This commit is contained in:
parent
e3e1a35f68
commit
b3c1f56737
|
@ -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…
Reference in New Issue