]> git.saurik.com Git - bison.git/commitdiff
* src/conflicts.c (print_reductions): Pessimize, but clarify.
authorAkim Demaille <akim@epita.fr>
Wed, 5 Dec 2001 09:30:56 +0000 (09:30 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 5 Dec 2001 09:30:56 +0000 (09:30 +0000)
ChangeLog
src/conflicts.c

index b4b1b51eb9682ada32c1e5a5ed1a23087be3d10e..3a20b7259daac6b525955d0059801d76b8723469 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-12-05  Akim Demaille  <akim@epita.fr>
+
+       * src/conflicts.c (print_reductions): Pessimize, but clarify.
+
+       
 2001-12-05  Akim Demaille  <akim@epita.fr>
 
        * src/conflicts.c (print_reductions): Improve variable locality.
index e26a7adf4142a71fd9df5bb11bc48443ba5ce473..357cbeb60405dfb32c3eb600b2ff7910de5301ff 100644 (file)
@@ -567,6 +567,7 @@ print_reductions (FILE *out, int state)
   else if (n - m >= 1)
     {
       unsigned *fp1, *fp2, *fp3, *fp4;
+      int k;
 
       cmax = 0;
       default_LA = -1;
@@ -575,28 +576,13 @@ print_reductions (FILE *out, int state)
       if (!nodefault)
        for (i = m; i < n; i++)
          {
-           fp1 = LA (i);
-           fp2 = shiftset;
-           fp3 = lookaheadset;
-
-           while (fp3 < fp4)
-             *fp3++ = *fp1++ & (~(*fp2++));
+           for (k = 0; k < tokensetsize; ++k)
+             lookaheadset[k] = LA (i)[k] & ~shiftset[k];
 
            count = 0;
-           mask = 1;
-           fp3 = lookaheadset;
            for (j = 0; j < ntokens; j++)
-             {
-               if (mask & *fp3)
-                 count++;
-
-               mask <<= 1;
-               if (mask == 0)
-                 {
-                   mask = 1;
-                   fp3++;
-                 }
-             }
+             if (BITISSET (lookaheadset, j))
+               count++;
 
            if (count > cmax)
              {
@@ -616,17 +602,15 @@ print_reductions (FILE *out, int state)
        shiftset[i] = 0;
 
       if (shiftp)
-       {
-         for (i = 0; i < shiftp->nshifts; i++)
-           {
-             if (!shiftp->shifts[i])
-               continue;
-             symbol = state_table[shiftp->shifts[i]].accessing_symbol;
-             if (ISVAR (symbol))
-               break;
-             SETBIT (shiftset, symbol);
-           }
-       }
+       for (i = 0; i < shiftp->nshifts; i++)
+         {
+           if (!shiftp->shifts[i])
+             continue;
+           symbol = state_table[shiftp->shifts[i]].accessing_symbol;
+           if (ISVAR (symbol))
+             break;
+           SETBIT (shiftset, symbol);
+         }
 
       mask = 1;
       fp1 = LA (m);