mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 08:43:03 +00:00
* src/closure.c (closure): Instead of looping over word in array
then bits in words, loop over bits in array.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2001-11-28 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/closure.c (closure): Instead of looping over word in array
|
||||||
|
then bits in words, loop over bits in array.
|
||||||
|
|
||||||
|
|
||||||
2001-11-28 Akim Demaille <akim@epita.fr>
|
2001-11-28 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* src/closure.c (closure): No longer optimize the special case
|
* src/closure.c (closure): No longer optimize the special case
|
||||||
|
|||||||
@@ -242,7 +242,8 @@ closure (short *core, int n)
|
|||||||
/* Index over RULESET. */
|
/* Index over RULESET. */
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
int itemno;
|
/* A bit index over RULESET. */
|
||||||
|
int b;
|
||||||
|
|
||||||
if (trace_flag)
|
if (trace_flag)
|
||||||
{
|
{
|
||||||
@@ -271,27 +272,22 @@ closure (short *core, int n)
|
|||||||
ruleno = 0;
|
ruleno = 0;
|
||||||
itemsetsize = 0;
|
itemsetsize = 0;
|
||||||
c = 0;
|
c = 0;
|
||||||
for (r = 0; r < rulesetsize; ++r)
|
for (b = 0; b < rulesetsize * BITS_PER_WORD; ++b)
|
||||||
{
|
{
|
||||||
int b;
|
if (BITISSET (ruleset, b))
|
||||||
|
|
||||||
for (b = 0; b < BITS_PER_WORD; b++)
|
|
||||||
{
|
{
|
||||||
if (ruleset[r] & (1 << b))
|
int itemno = rule_table[ruleno].rhs;
|
||||||
|
while (c < n && core[c] < itemno)
|
||||||
{
|
{
|
||||||
itemno = rule_table[ruleno].rhs;
|
itemset[itemsetsize] = core[c];
|
||||||
while (c < n && core[c] < itemno)
|
|
||||||
{
|
|
||||||
itemset[itemsetsize] = core[c];
|
|
||||||
itemsetsize++;
|
|
||||||
c++;
|
|
||||||
}
|
|
||||||
itemset[itemsetsize] = itemno;
|
|
||||||
itemsetsize++;
|
itemsetsize++;
|
||||||
|
c++;
|
||||||
}
|
}
|
||||||
|
itemset[itemsetsize] = itemno;
|
||||||
ruleno++;
|
itemsetsize++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ruleno++;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (c < n)
|
while (c < n)
|
||||||
|
|||||||
Reference in New Issue
Block a user