diff options
author | Stephen Dolan <mu@netsoc.tcd.ie> | 2013-05-15 01:23:06 +0100 |
---|---|---|
committer | Stephen Dolan <mu@netsoc.tcd.ie> | 2013-05-15 01:23:06 +0100 |
commit | 1e2851cdb3add02948e28ba2e80594794bbcffb3 (patch) | |
tree | 98f6746ea26ff60c167477e51035119c99314cc3 /compile.c | |
parent | e83e51eb56a1de6e627d346f027d3ceb09ae3807 (diff) |
Remove the YIELD opcode (use RET instead)
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -507,13 +507,7 @@ static int compile(struct locfile* locations, struct bytecode* bc, block b) { int var_frame_idx = 0; bc->nsubfunctions = 0; errors += expand_call_arglist(locations, &b); - if (bc->parent) { - // functions should end in a return - b = BLOCK(b, gen_op_simple(RET)); - } else { - // the toplevel should YIELD;BACKTRACK; when it finds an answer - b = BLOCK(b, gen_op_simple(YIELD), gen_op_simple(BACKTRACK)); - } + b = BLOCK(b, gen_op_simple(RET)); for (inst* curr = b.first; curr; curr = curr->next) { if (!curr->next) assert(curr == b.last); int length = opcode_describe(curr->op)->length; |