Simplify x87_dump_stack().
authorChristoph Mallon <christoph.mallon@gmx.de>
Fri, 2 Nov 2012 14:18:39 +0000 (15:18 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Mon, 5 Nov 2012 17:07:18 +0000 (18:07 +0100)
ir/be/ia32/ia32_x87.c

index 24b1b25..4019e5c 100644 (file)
@@ -172,19 +172,6 @@ static int x87_get_st_reg(const x87_state *state, int pos)
 }
 
 #ifdef DEBUG_libfirm
-/**
- * Return the node at st(pos).
- *
- * @param state  the x87 state
- * @param pos    a stack position
- *
- * @return the IR node that produced the value at st(pos)
- */
-static ir_node *x87_get_st_node(const x87_state *state, int pos)
-{
-       return x87_get_entry((x87_state*)state, pos)->node;
-}
-
 /**
  * Dump the stack for debugging.
  *
@@ -192,11 +179,9 @@ static ir_node *x87_get_st_node(const x87_state *state, int pos)
  */
 static void x87_dump_stack(const x87_state *state)
 {
-       int i;
-
-       for (i = state->depth - 1; i >= 0; --i) {
-               DB((dbg, LEVEL_2, "vf%d(%+F) ", x87_get_st_reg(state, i),
-                   x87_get_st_node(state, i)));
+       for (int i = state->depth; i-- != 0;) {
+               st_entry const *const entry = x87_get_entry((x87_state*)state, i);
+               DB((dbg, LEVEL_2, "vf%d(%+F) ", entry->reg_idx, entry->node));
        }
        DB((dbg, LEVEL_2, "<-- TOS\n"));
 }