[llvm] r302487 - [APInt] Use default constructor instead of explicitly creating a 1-bit APInt in udiv and urem. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon May 8 16:49:54 PDT 2017
Author: ctopper
Date: Mon May 8 18:49:54 2017
New Revision: 302487
URL: http://llvm.org/viewvc/llvm-project?rev=302487&view=rev
Log:
[APInt] Use default constructor instead of explicitly creating a 1-bit APInt in udiv and urem. NFC
The default constructor does the same thing.
Modified:
llvm/trunk/lib/Support/APInt.cpp
Modified: llvm/trunk/lib/Support/APInt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=302487&r1=302486&r2=302487&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Mon May 8 18:49:54 2017
@@ -1599,7 +1599,7 @@ APInt APInt::udiv(const APInt& RHS) cons
return APInt(BitWidth, this->U.pVal[0] / RHS.U.pVal[0]);
// We have to compute it the hard way. Invoke the Knuth divide algorithm.
- APInt Quotient(1,0); // to hold result.
+ APInt Quotient; // to hold result.
divide(*this, lhsWords, RHS, rhsWords, &Quotient, nullptr);
return Quotient;
}
@@ -1646,7 +1646,7 @@ APInt APInt::urem(const APInt& RHS) cons
return APInt(BitWidth, U.pVal[0] % RHS.U.pVal[0]);
// We have to compute it the hard way. Invoke the Knuth divide algorithm.
- APInt Remainder(1,0);
+ APInt Remainder;
divide(*this, lhsWords, RHS, rhsWords, nullptr, &Remainder);
return Remainder;
}
More information about the llvm-commits
mailing list