]> granicus.if.org Git - re2c/commitdiff
Removed dead code.
authorUlya Trofimovich <skvadrik@gmail.com>
Wed, 4 Mar 2015 13:12:19 +0000 (13:12 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Wed, 4 Mar 2015 13:12:19 +0000 (13:12 +0000)
Used 'if (next) assert(next->label == from->label + 1);'
to ensure that code is really dead (and 'next' is always
the next state to 'from').

re2c/code.cc

index 2dd7239d9819d2cea744463e42c525ca11b56a00..f96bc1fbeea684d34dd3684d5876f3cbc32ab407 100644 (file)
@@ -736,7 +736,7 @@ static void doLinear(OutputFile & o, uint ind, Span *s, uint n, const State *fro
                                        genIf(o, ind, "!=", s[0].ub, readCh);
                                        genGoTo(o, 0, from, bg, readCh);
                                }
-                               if (next->label != from->label + 1 || DFlag)
+                               if (DFlag)
                                {
                                        genGoTo(o, ind, from, next, readCh);
                                }
@@ -757,12 +757,10 @@ static void doLinear(OutputFile & o, uint ind, Span *s, uint n, const State *fro
 
                if (n == 1)
                {
-                       //              if(bg != next){
                        if (s[0].to->label != from->label + 1 || DFlag)
                        {
                                genGoTo(o, ind, from, s[0].to, readCh);
                        }
-                       //              }
                        return ;
                }
                else if (n == 2 && bg == next)
@@ -772,7 +770,7 @@ static void doLinear(OutputFile & o, uint ind, Span *s, uint n, const State *fro
                                genIf(o, ind, ">=", s[0].ub, readCh);
                                genGoTo(o, 0, from, s[1].to, readCh);
                        }
-                       if (next->label != from->label + 1 || DFlag)
+                       if (DFlag)
                        {
                                genGoTo(o, ind, from, next, readCh);
                        }
@@ -790,7 +788,7 @@ static void doLinear(OutputFile & o, uint ind, Span *s, uint n, const State *fro
                }
        }
 
-       if (next->label != from->label + 1 || DFlag)
+       if (DFlag)
        {
                genGoTo(o, ind, from, next, readCh);
        }