From: Michael Beck Date: Sun, 5 Mar 2006 01:15:08 +0000 (+0000) Subject: clean up a bit X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=7adfc6752d50cc93b8e3c9f591565c42569ce134;p=libfirm clean up a bit --- diff --git a/ir/be/ia32/ia32_emitter.c b/ir/be/ia32/ia32_emitter.c index 650e0c1b9..3e63b8630 100644 --- a/ir/be/ia32/ia32_emitter.c +++ b/ir/be/ia32/ia32_emitter.c @@ -229,13 +229,18 @@ int get_ia32_reg_nr(ir_node *irn, int pos, int in_out) { return arch_register_get_index(reg); } +enum io_direction { + IN_REG, + OUT_REG +}; + /** * Returns the name of the in register at position pos. */ -const char *get_ia32_reg_name(ir_node *irn, int pos, int in_out) { +static const char *get_ia32_reg_name(ir_node *irn, int pos, enum io_direction in_out) { const arch_register_t *reg; - if (in_out == 1) { + if (in_out == IN_REG) { reg = get_in_reg(irn, pos); } else { @@ -258,12 +263,7 @@ static int ia32_get_reg_name(lc_appendable_t *app, if (!X) return lc_arg_append(app, occ, "(null)", 6); - if (occ->conversion == 'S') { - buf = get_ia32_reg_name(X, nr, 1); - } - else { /* 'D' */ - buf = get_ia32_reg_name(X, nr, 0); - } + buf = get_ia32_reg_name(X, nr, occ->conversion == 'S' ? IN_REG : OUT_REG); lc_appendable_chadd(app, '%'); return lc_arg_append(app, occ, buf, strlen(buf));