[llvm] r302626 - [APInt] Fix indentation of tcDivide. Combine variable declaration and initialization.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 00:50:18 PDT 2017


Author: ctopper
Date: Wed May 10 02:50:17 2017
New Revision: 302626

URL: http://llvm.org/viewvc/llvm-project?rev=302626&view=rev
Log:
[APInt] Fix indentation of tcDivide. Combine variable declaration and initialization.

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=302626&r1=302625&r2=302626&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Wed May 10 02:50:17 2017
@@ -2386,22 +2386,20 @@ int APInt::tcDivide(WordType *lhs, const
   /* Loop, subtracting SRHS if REMAINDER is greater and adding that to
      the total.  */
   for (;;) {
-      int compare;
+    int compare = tcCompare(remainder, srhs, parts);
+    if (compare >= 0) {
+      tcSubtract(remainder, srhs, 0, parts);
+      lhs[n] |= mask;
+    }
 
-      compare = tcCompare(remainder, srhs, parts);
-      if (compare >= 0) {
-        tcSubtract(remainder, srhs, 0, parts);
-        lhs[n] |= mask;
-      }
-
-      if (shiftCount == 0)
-        break;
-      shiftCount--;
-      tcShiftRight(srhs, parts, 1);
-      if ((mask >>= 1) == 0) {
-        mask = (WordType) 1 << (APINT_BITS_PER_WORD - 1);
-        n--;
-      }
+    if (shiftCount == 0)
+      break;
+    shiftCount--;
+    tcShiftRight(srhs, parts, 1);
+    if ((mask >>= 1) == 0) {
+      mask = (WordType) 1 << (APINT_BITS_PER_WORD - 1);
+      n--;
+    }
   }
 
   return false;




More information about the llvm-commits mailing list