Get rid of IR_JUMP and related code.

This commit is contained in:
Brian 2007-03-26 17:16:26 -06:00
parent 037c068460
commit 6583429f89
3 changed files with 2 additions and 25 deletions

View file

@ -710,22 +710,6 @@ emit_label(slang_emit_info *emitInfo, const slang_ir_node *n)
}
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)
{
@ -1517,10 +1501,7 @@ emit(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);

View file

@ -74,7 +74,6 @@ static const slang_ir_info IrInfo[] = {
{ 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 },
@ -281,9 +280,6 @@ _slang_print_ir_tree(const slang_ir_node *n, int indent)
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");

View file

@ -49,7 +49,7 @@ typedef enum
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 */