]> granicus.if.org Git - llvm/commitdiff
[APInt] Use default constructor instead of explicitly creating a 1-bit APInt in udiv...
authorCraig Topper <craig.topper@gmail.com>
Mon, 8 May 2017 23:49:54 +0000 (23:49 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 8 May 2017 23:49:54 +0000 (23:49 +0000)
The default constructor does the same thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302487 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/APInt.cpp

index 774fe86f106b979a30f39dc8f11c877d5255efdb..c7685c3a730de804d438e4c02c5c6c0e1e94071d 100644 (file)
@@ -1599,7 +1599,7 @@ APInt APInt::udiv(const APInt& RHS) const {
     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) const {
     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;
 }