Merge pull request #3009 from xTachyon/bettercpp
Serialized ATN const array generates horrible machine code fix
This commit is contained in:
commit
0f8bddcbc1
|
@ -289,3 +289,4 @@ YYYY/MM/DD, github id, Full name, email
|
|||
2021/02/21, namasikanam, Xingyu Xie, namasikanam@gmail.com
|
||||
2021/02/27, khmarbaise, Karl Heinz Marbaise, github@soebes.com
|
||||
2021/03/02, hackeris
|
||||
2021/03/03, xTachyon, Damian Andrei, xTachyon@users.noreply.github.com
|
||||
|
|
|
@ -422,8 +422,7 @@ static std::vector\<uint16_t> _serializedATN;
|
|||
|
||||
// Constructs the serialized ATN and writes init code for static member vars.
|
||||
SerializedATN(model) ::= <<
|
||||
<if (rest(model.segments))>
|
||||
<model.segments: {segment | static uint16_t serializedATNSegment<i0>[] = {
|
||||
<model.segments: {segment | static const uint16_t serializedATNSegment<i0>[] = {
|
||||
<segment; wrap={<\n> }>
|
||||
\};}; separator="\n">
|
||||
|
||||
|
@ -431,13 +430,6 @@ SerializedATN(model) ::= <<
|
|||
serializedATNSegment<i0> + sizeof(serializedATNSegment<i0>) / sizeof(serializedATNSegment<i0>[0]));
|
||||
}>
|
||||
|
||||
<else>
|
||||
<! only one segment, can be inlined !>
|
||||
_serializedATN = {
|
||||
<model.serialized; wrap = {<\n>}>
|
||||
};
|
||||
<endif>
|
||||
|
||||
atn::ATNDeserializer deserializer;
|
||||
_atn = deserializer.deserialize(_serializedATN);
|
||||
|
||||
|
|
Loading…
Reference in New Issue