mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 09:13:04 +00:00
* src/conflicts.c (print_reductions): Pessimize, but clarify.
This commit is contained in:
@@ -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>
|
2001-12-05 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* src/conflicts.c (print_reductions): Improve variable locality.
|
* src/conflicts.c (print_reductions): Improve variable locality.
|
||||||
|
|||||||
@@ -567,6 +567,7 @@ print_reductions (FILE *out, int state)
|
|||||||
else if (n - m >= 1)
|
else if (n - m >= 1)
|
||||||
{
|
{
|
||||||
unsigned *fp1, *fp2, *fp3, *fp4;
|
unsigned *fp1, *fp2, *fp3, *fp4;
|
||||||
|
int k;
|
||||||
|
|
||||||
cmax = 0;
|
cmax = 0;
|
||||||
default_LA = -1;
|
default_LA = -1;
|
||||||
@@ -575,28 +576,13 @@ print_reductions (FILE *out, int state)
|
|||||||
if (!nodefault)
|
if (!nodefault)
|
||||||
for (i = m; i < n; i++)
|
for (i = m; i < n; i++)
|
||||||
{
|
{
|
||||||
fp1 = LA (i);
|
for (k = 0; k < tokensetsize; ++k)
|
||||||
fp2 = shiftset;
|
lookaheadset[k] = LA (i)[k] & ~shiftset[k];
|
||||||
fp3 = lookaheadset;
|
|
||||||
|
|
||||||
while (fp3 < fp4)
|
|
||||||
*fp3++ = *fp1++ & (~(*fp2++));
|
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
mask = 1;
|
|
||||||
fp3 = lookaheadset;
|
|
||||||
for (j = 0; j < ntokens; j++)
|
for (j = 0; j < ntokens; j++)
|
||||||
{
|
if (BITISSET (lookaheadset, j))
|
||||||
if (mask & *fp3)
|
count++;
|
||||||
count++;
|
|
||||||
|
|
||||||
mask <<= 1;
|
|
||||||
if (mask == 0)
|
|
||||||
{
|
|
||||||
mask = 1;
|
|
||||||
fp3++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count > cmax)
|
if (count > cmax)
|
||||||
{
|
{
|
||||||
@@ -616,17 +602,15 @@ print_reductions (FILE *out, int state)
|
|||||||
shiftset[i] = 0;
|
shiftset[i] = 0;
|
||||||
|
|
||||||
if (shiftp)
|
if (shiftp)
|
||||||
{
|
for (i = 0; i < shiftp->nshifts; i++)
|
||||||
for (i = 0; i < shiftp->nshifts; i++)
|
{
|
||||||
{
|
if (!shiftp->shifts[i])
|
||||||
if (!shiftp->shifts[i])
|
continue;
|
||||||
continue;
|
symbol = state_table[shiftp->shifts[i]].accessing_symbol;
|
||||||
symbol = state_table[shiftp->shifts[i]].accessing_symbol;
|
if (ISVAR (symbol))
|
||||||
if (ISVAR (symbol))
|
break;
|
||||||
break;
|
SETBIT (shiftset, symbol);
|
||||||
SETBIT (shiftset, symbol);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mask = 1;
|
mask = 1;
|
||||||
fp1 = LA (m);
|
fp1 = LA (m);
|
||||||
|
|||||||
Reference in New Issue
Block a user