]> git.saurik.com Git - bison.git/commitdiff
As a result of the previous patch, it is no longer needed
authorAkim Demaille <akim@epita.fr>
Sun, 7 Apr 2002 17:41:08 +0000 (17:41 +0000)
committerAkim Demaille <akim@epita.fr>
Sun, 7 Apr 2002 17:41:08 +0000 (17:41 +0000)
to reorder ritem itself.
* src/reduce.c (reduce_grammar_tables): Don't sort RITEM.

ChangeLog
src/reduce.c

index 02980f5220113a922c917cf8cc0c928af0cf06fe..09c3479e18706798781516d52144afd61f7555ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-04-07  Akim Demaille  <akim@epita.fr>
+
+       As a result of the previous patch, it is no longer needed
+       to reorder ritem itself.
+
+       * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
+
 2002-04-07  Akim Demaille  <akim@epita.fr>
 
        Be sure never to walk through RITEMS, but use only data related to
index db033b34113a7aab9c7b3e9eaf2fe196ec5d7b4b..7cdc76aba6c2b54edf33cca09696c5b8402d0d46 100644 (file)
@@ -248,22 +248,14 @@ reduce_grammar_tables (void)
     free (rules + 1);
     rules = rules_sorted;
 
-    /* Also reorder ritems. */
-    {
-      short *ritems_sorted = XCALLOC (short, nitems + 1);
-      short *ritemsp = ritems_sorted;
-      for (i = 1; i < nrules + 1; ++i)
-       {
-         short *rhsp = rules[i].rhs;
-         rules[i].rhs = ritemsp;
-         for (/* Nothing. */; *rhsp >= 0; ++rhsp)
-           *ritemsp++ = *rhsp;
-         *ritemsp++ = -i;
-       }
-      *ritemsp++ = 0;
-      free (ritem);
-      ritem = ritems_sorted;
-    }
+    /* Renumber the rules markers in RITEMS.  */
+    for (i = 1; i < nrules + 1; ++i)
+      {
+       short *rhsp = rules[i].rhs;
+       for (/* Nothing. */; *rhsp >= 0; ++rhsp)
+         /* Nothing. */;
+       *rhsp = -i;
+      }
     nrules -= nuseless_productions;
   }