]> granicus.if.org Git - llvm/commitdiff
[APInt] Use getRawData to slightly simplify some code.
authorCraig Topper <craig.topper@gmail.com>
Wed, 10 May 2017 18:15:17 +0000 (18:15 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 10 May 2017 18:15:17 +0000 (18:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302702 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/APInt.cpp

index 7559e46a3c2dd4bbddeb1d4ae6581e1239b5ed54..9bf9b4cd2e63ceb25d44589b1d377c2a601d8d36 100644 (file)
@@ -1431,7 +1431,7 @@ void APInt::divide(const APInt &LHS, unsigned lhsWords, const APInt &RHS,
   // Initialize the dividend
   memset(U, 0, (m+n+1)*sizeof(unsigned));
   for (unsigned i = 0; i < lhsWords; ++i) {
-    uint64_t tmp = (LHS.getNumWords() == 1 ? LHS.U.VAL : LHS.U.pVal[i]);
+    uint64_t tmp = LHS.getRawData()[i];
     U[i * 2] = (unsigned)(tmp & mask);
     U[i * 2 + 1] = (unsigned)(tmp >> (sizeof(unsigned)*CHAR_BIT));
   }
@@ -1440,7 +1440,7 @@ void APInt::divide(const APInt &LHS, unsigned lhsWords, const APInt &RHS,
   // Initialize the divisor
   memset(V, 0, (n)*sizeof(unsigned));
   for (unsigned i = 0; i < rhsWords; ++i) {
-    uint64_t tmp = (RHS.getNumWords() == 1 ? RHS.U.VAL : RHS.U.pVal[i]);
+    uint64_t tmp = RHS.getRawData()[i];
     V[i * 2] = (unsigned)(tmp & mask);
     V[i * 2 + 1] = (unsigned)(tmp >> (sizeof(unsigned)*CHAR_BIT));
   }