]> granicus.if.org Git - re2c/commitdiff
Removed variable from global scope.
authorUlya Trofimovich <skvadrik@gmail.com>
Mon, 19 Dec 2016 08:37:46 +0000 (08:37 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Mon, 19 Dec 2016 08:37:46 +0000 (08:37 +0000)
re2c/src/codegen/emit_dfa.cc
re2c/src/codegen/output.cc
re2c/src/codegen/output.h
re2c/src/globals.h
re2c/src/main.cc
re2c/src/parse/scanner.cc

index 8cef48e13d9151d2394c32314921624d88021aab..3cb59c91f45d32224fc03c72c9fff5772df62183 100644 (file)
@@ -203,7 +203,7 @@ void DFA::emit(Output & output, uint32_t& ind, bool isLastCond, bool& bPrologBra
                        ||  (!opts->fFlag && opts->bEmitYYCh)
                        ||  (opts->bFlag && !opts->cFlag && !bitmaps.empty())
                        ||  (opts->cFlag && !bWroteCondCheck && opts->gFlag)
-                       ||  (opts->fFlag && !bWroteGetState && opts->gFlag)
+                       ||  (opts->fFlag && !o.state_goto && opts->gFlag)
                        )
                        {
                                bPrologBrace = true;
index 874080c337ca7dd5c82a6a16546ce338347226a8..7cc7f5dc997e672eb18366ca3de4cfa7f612f3ba 100644 (file)
@@ -65,6 +65,7 @@ OutputFile::OutputFile(Opt &o, Warn &w)
        : blocks ()
        , label_counter ()
        , fill_index(0)
+       , state_goto(false)
        , warn_condition_order (!o->tFlag) // see note [condition order]
        , opts(o)
        , warn(w)
@@ -209,11 +210,10 @@ OutputFile & OutputFile::wdelay_line_info ()
 
 OutputFile & OutputFile::wdelay_state_goto (uint32_t ind)
 {
-       if (opts->fFlag && !bWroteGetState)
-       {
+       if (opts->fFlag && !state_goto) {
                block().fragments.push_back (new OutputFragment (OutputFragment::STATE_GOTO, ind));
                insert_code ();
-               bWroteGetState = true;
+               state_goto = true;
        }
        return *this;
 }
index 5e3afbb86d01e4d13512cf26c06c0d25eac3e301..47aedc1b595aa2a15774485fcd4b603f73f31fe2 100644 (file)
@@ -78,6 +78,7 @@ class OutputFile
 public:
        counter_t<label_t> label_counter;
        uint32_t fill_index;
+       bool state_goto;
        bool warn_condition_order;
        Opt &opts;
        Warn &warn;
index 4d158ea72f364a50651e31d9a5efe0b17cee3167..2210e98aa2f8cd78b64b0f405a7841f8f098024b 100644 (file)
@@ -4,7 +4,6 @@
 namespace re2c
 {
 
-extern bool bWroteGetState;
 extern bool bWroteCondCheck;
 
 } // end namespace re2c
index f5029811e5a34e2fda2a63ee24ccda76b04b442c..37f69715f41c15437905f0996d8c3cf1a4020ef3 100644 (file)
@@ -13,7 +13,6 @@
 namespace re2c
 {
 
-bool bWroteGetState = false;
 bool bWroteCondCheck = false;
 
 } // end namespace re2c
index b765820731608d69179dcfc1adccb2636a7f3b2d..f1656109735b7a6462e54a3ff5e55a39fbd85a7e 100644 (file)
@@ -182,7 +182,7 @@ void Scanner::reuse()
 {
        out.label_counter.reset ();
        out.fill_index = 0;
-       bWroteGetState = false;
+       out.state_goto = false;
        bWroteCondCheck = false;
        opts.reset_mapCodeName ();
 }