From: Akim Demaille Date: Wed, 5 Dec 2001 09:30:28 +0000 (+0000) Subject: * src/conflicts.c (print_reductions): Pessimize, but clarify. X-Git-Tag: before-m4-back-end~203 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/a04bc341806e1e423b2475eece725e7835af2b12 * src/conflicts.c (print_reductions): Pessimize, but clarify. --- diff --git a/ChangeLog b/ChangeLog index 34324ab1..49745e7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-12-05 Akim Demaille + + * src/conflicts.c (print_reductions): Pessimize, but clarify. + + 2001-12-05 Akim Demaille * src/conflicts.c (print_reductions): Improve variable locality. diff --git a/src/conflicts.c b/src/conflicts.c index 0275891d..ae5c79e4 100644 --- a/src/conflicts.c +++ b/src/conflicts.c @@ -551,33 +551,17 @@ print_reductions (FILE *out, int state) if (n - m == 1 && !nodefault) { - unsigned *fp1 = LA (m); - unsigned *fp2 = shiftset; - unsigned *fp3 = lookaheadset; - unsigned *fp4 = lookaheadset + tokensetsize; - + int k; default_rule = LAruleno[m]; - while (fp3 < fp4) - *fp3++ = *fp1++ & *fp2++; - - mask = 1; - fp3 = lookaheadset; + for (k = 0; k < tokensetsize; ++k) + lookaheadset[k] = LA (m)[k] & shiftset[k]; for (i = 0; i < ntokens; i++) - { - if (mask & *fp3) - fprintf (out, _(" %-4s\t[reduce using rule %d (%s)]\n"), - tags[i], default_rule, - tags[rule_table[default_rule].lhs]); - - mask <<= 1; - if (mask == 0) - { - mask = 1; - fp3++; - } - } + if (BITISSET (lookaheadset, i)) + fprintf (out, _(" %-4s\t[reduce using rule %d (%s)]\n"), + tags[i], default_rule, + tags[rule_table[default_rule].lhs]); fprintf (out, _(" $default\treduce using rule %d (%s)\n\n"), default_rule, tags[rule_table[default_rule].lhs]);