[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:
Craig Topper 2017-05-11 07:02:04 +00:00
parent e3e1a35f68
commit b3c1f56737
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}