diff options
author | Adrian Thurston <thurston@colm.net> | 2018-05-11 18:21:09 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2018-05-11 18:21:09 -0400 |
commit | a6920ce0f199c772ede76f0ae475cbf99d9f58bf (patch) | |
tree | 4a72c9835f2a0eaa7504fd456fe0f70daecc0b5d /src/synthesis.cc | |
parent | 4391ff975a49a0f416bde7c82307989424ef3ff5 (diff) | |
download | colm-a6920ce0f199c772ede76f0ae475cbf99d9f58bf.tar.gz |
merged the WC and WV versions of parse instructions
Diffstat (limited to 'src/synthesis.cc')
-rw-r--r-- | src/synthesis.cc | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/src/synthesis.cc b/src/synthesis.cc index d641e9ee..c40c25dc 100644 --- a/src/synthesis.cc +++ b/src/synthesis.cc @@ -1025,8 +1025,7 @@ void LangVarRef::resetActiveRefs( Compiler *pd, VarRefLookup &lookup, bool LangVarRef::isFinishCall( VarRefLookup &lookup ) const { - if ( lookup.objMethod->opcodeWV == IN_PARSE_FINISH_WV || - lookup.objMethod->opcodeWC == IN_PARSE_FINISH_WC ) + if ( lookup.objMethod->opcodeWV == IN_PARSE_FINISH_W ) { return true; } @@ -1424,40 +1423,21 @@ UniqueType *LangTerm::evaluateConstruct( Compiler *pd, CodeVect &code ) const void LangTerm::parseFrag( Compiler *pd, CodeVect &code, int stopId ) { - /* Parse instruction, dependent on whether or not we are producing - * revert or commit code. */ - if ( pd->revertOn ) { - code.append( IN_PARSE_LOAD ); - code.append( IN_PARSE_FRAG_WV ); - code.appendHalf( stopId ); - code.append( IN_PCR_CALL ); - code.append( IN_PARSE_FRAG_EXIT_WV ); - } - else { - code.append( IN_PARSE_LOAD ); - code.append( IN_PARSE_FRAG_WC ); - code.appendHalf( stopId ); - code.append( IN_PCR_CALL ); - code.append( IN_PARSE_FRAG_EXIT_WC ); - } + /* Parse instruction. */ + code.append( IN_PARSE_LOAD ); + code.append( IN_PARSE_FRAG_W ); + code.appendHalf( stopId ); + code.append( IN_PCR_CALL ); + code.append( IN_PARSE_FRAG_EXIT_W ); } void LangTerm::parseFinish( Compiler *pd, CodeVect &code, int stopId ) { - if ( pd->revertOn ) { - code.append( IN_PARSE_LOAD ); - code.append( IN_PARSE_FINISH_WV ); - code.appendHalf( stopId ); - code.append( IN_PCR_CALL ); - code.append( IN_PARSE_FINISH_EXIT_WV ); - } - else { - code.append( IN_PARSE_LOAD ); - code.append( IN_PARSE_FINISH_WC ); - code.appendHalf( stopId ); - code.append( IN_PCR_CALL ); - code.append( IN_PARSE_FINISH_EXIT_WC ); - } + code.append( IN_PARSE_LOAD ); + code.append( IN_PARSE_FINISH_W ); + code.appendHalf( stopId ); + code.append( IN_PCR_CALL ); + code.append( IN_PARSE_FINISH_EXIT_W ); } UniqueType *LangTerm::evaluateReadReduce( Compiler *pd, CodeVect &code ) const |