From: Akim Demaille Date: Wed, 5 Dec 2001 09:30:13 +0000 (+0000) Subject: * src/conflicts.c (print_reductions): Improve variable locality. X-Git-Tag: before-m4-back-end~204 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/c8ea038e69638acf5fac2407a2b1242a0021b9d0?hp=aa2aab3c165a39d7ec65696223479c343731a98e * src/conflicts.c (print_reductions): Improve variable locality. --- diff --git a/ChangeLog b/ChangeLog index a8687e65..34324ab1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-12-05 Akim Demaille + + * src/conflicts.c (print_reductions): Improve variable locality. + + 2001-12-05 Akim Demaille * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New. diff --git a/src/conflicts.c b/src/conflicts.c index 82ce1460..0275891d 100644 --- a/src/conflicts.c +++ b/src/conflicts.c @@ -502,11 +502,6 @@ print_reductions (FILE *out, int state) { int i; int j; - int k; - unsigned *fp1; - unsigned *fp2; - unsigned *fp3; - unsigned *fp4; int rule; int symbol; unsigned mask; @@ -525,28 +520,24 @@ print_reductions (FILE *out, int state) shiftp = state_table[state].shift_table; if (shiftp) - { - k = shiftp->nshifts; - for (i = 0; i < k; i++) - { - if (!shiftp->shifts[i]) - continue; - symbol = state_table[shiftp->shifts[i]].accessing_symbol; - if (ISVAR (symbol)) - break; - /* if this state has a shift for the error token, - don't use a default rule. */ - if (symbol == error_token_number) - nodefault = 1; - 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; + /* if this state has a shift for the error token, + don't use a default rule. */ + if (symbol == error_token_number) + nodefault = 1; + SETBIT (shiftset, symbol); + } errp = err_table[state]; if (errp) { - k = errp->nerrs; - for (i = 0; i < k; i++) + for (i = 0; i < errp->nerrs; i++) { if (!errp->errs[i]) continue; @@ -560,12 +551,12 @@ print_reductions (FILE *out, int state) if (n - m == 1 && !nodefault) { - default_rule = LAruleno[m]; + unsigned *fp1 = LA (m); + unsigned *fp2 = shiftset; + unsigned *fp3 = lookaheadset; + unsigned *fp4 = lookaheadset + tokensetsize; - fp1 = LA (m); - fp2 = shiftset; - fp3 = lookaheadset; - fp4 = lookaheadset + tokensetsize; + default_rule = LAruleno[m]; while (fp3 < fp4) *fp3++ = *fp1++ & *fp2++; @@ -593,6 +584,8 @@ print_reductions (FILE *out, int state) } else if (n - m >= 1) { + unsigned *fp1, *fp2, *fp3, *fp4; + cmax = 0; default_LA = -1; fp4 = lookaheadset + tokensetsize; @@ -642,8 +635,7 @@ print_reductions (FILE *out, int state) if (shiftp) { - k = shiftp->nshifts; - for (i = 0; i < k; i++) + for (i = 0; i < shiftp->nshifts; i++) { if (!shiftp->shifts[i]) continue;