From 52e60c1c95eb0bdee09debbc01594d29405796ae Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Wed, 8 Oct 2008 09:32:42 +0000 Subject: [PATCH] Slightly simplify jump table emitter. [r22600] --- ir/be/ia32/ia32_emitter.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ir/be/ia32/ia32_emitter.c b/ir/be/ia32/ia32_emitter.c index 9cbde330e..0c4656ab9 100644 --- a/ir/be/ia32/ia32_emitter.c +++ b/ir/be/ia32/ia32_emitter.c @@ -1125,20 +1125,18 @@ static void emit_ia32_SwitchJmp(const ir_node *node) be_emit_cstring(":\n"); be_emit_write_line(); - be_emit_cstring(".long "); - ia32_emit_cfop_target(tbl.branches[0].target); - be_emit_finish_line_gas(NULL); - last_value = tbl.branches[0].value; - for (i = 1; i < tbl.num_branches; ++i) { - while (++last_value < tbl.branches[i].value) { + for (i = 0; i != tbl.num_branches; ++i) { + while (last_value != tbl.branches[i].value) { be_emit_cstring(".long "); ia32_emit_cfop_target(tbl.defProj); be_emit_finish_line_gas(NULL); + ++last_value; } be_emit_cstring(".long "); ia32_emit_cfop_target(tbl.branches[i].target); be_emit_finish_line_gas(NULL); + ++last_value; } be_gas_emit_switch_section(GAS_SECTION_TEXT); } else { -- 2.20.1