llvm.org GIT mirror llvm / e743591
[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 Craig Topper 3 years ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
17091709 APInt::udivrem(-LHS, -RHS, Quotient, Remainder);
17101710 else {
17111711 APInt::udivrem(-LHS, RHS, Quotient, Remainder);
1712 Quotient = -Quotient;
1713 }
1714 Remainder = -Remainder;
1712 Quotient.negate();
1713 }
1714 Remainder.negate();
17151715 } else if (RHS.isNegative()) {
17161716 APInt::udivrem(LHS, -RHS, Quotient, Remainder);
1717 Quotient = -Quotient;
1717 Quotient.negate();
17181718 } else {
17191719 APInt::udivrem(LHS, RHS, Quotient, Remainder);
17201720 }