}
-static struct prog_instruction *
-emit_jump(slang_emit_info *emitInfo, slang_ir_node *n)
-{
- struct prog_instruction *inst;
- assert(n);
- assert(n->Label);
- inst = new_instruction(emitInfo, OPCODE_BRA);
- inst->DstReg.CondMask = COND_TR; /* always branch */
- inst->BranchTarget = _slang_label_get_location(n->Label);
- if (inst->BranchTarget < 0) {
- _slang_label_add_reference(n->Label, emitInfo->prog->NumInstructions - 1);
- }
- return inst;
-}
-
-
static struct prog_instruction *
emit_return(slang_emit_info *emitInfo, slang_ir_node *n)
{
case IR_LABEL:
return emit_label(emitInfo, n);
- case IR_JUMP:
- assert(n);
- assert(n->Label);
- return emit_jump(emitInfo, n);
+
case IR_KILL:
return emit_kill(emitInfo);
{ IR_SEQ, "IR_SEQ", OPCODE_NOP, 0, 0 },
{ IR_SCOPE, "IR_SCOPE", OPCODE_NOP, 0, 0 },
{ IR_LABEL, "IR_LABEL", OPCODE_NOP, 0, 0 },
- { IR_JUMP, "IR_JUMP", OPCODE_NOP, 0, 0 },
{ IR_IF, "IR_IF", OPCODE_NOP, 0, 0 },
{ IR_KILL, "IR_KILL", OPCODE_NOP, 0, 0 },
{ IR_COND, "IR_COND", OPCODE_NOP, 0, 0 },
printf("COND\n");
_slang_print_ir_tree(n->Children[0], indent + 3);
break;
- case IR_JUMP:
- printf("JUMP %s\n", n->Label->Name);
- break;
case IR_IF:
printf("IF \n");
IR_SCOPE, /* new variable scope (one child) */
IR_LABEL, /* target of a jump or cjump */
- IR_JUMP, /* unconditional jump */
+
IR_COND, /* conditional expression/predicate */
IR_IF, /* high-level IF/then/else */