added DBG_OPT_LEA( to report Lea craetion to the firm statistic module
[libfirm] / ir / be / ia32 / ia32_x87.c
index 97d68af..010efd8 100644 (file)
 #include "gen_ia32_regalloc_if.h"
 #include "ia32_x87.h"
 
-#ifndef NDEBUG
-#define DEBUG_ONLY(x) x
-#else  /* NDEBUG */
-#define DEBUG_ONLY(x)
-#endif /* NDEBUG */
-
 #define N_x87_REGS 8
 
 /* first and second binop index */
@@ -54,7 +48,7 @@
 #define MASK_TOS(x)            ((x) & (N_x87_REGS - 1))
 
 /** the debug handle */
-static firm_dbg_module_t *dbg = NULL;
+DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
 
 /**
  * An exchange template.
@@ -1070,8 +1064,10 @@ static void x87_init_simulator(x87_simulator *sim, ir_graph *irg, const arch_env
        sim->blk_states = pmap_create();
        sim->env        = env;
 
-  FIRM_DBG_REGISTER(dbg, "firm.be.ia32.x87");
+       FIRM_DBG_REGISTER(dbg, "firm.be.ia32.x87");
+#ifndef DEBUG_libfirm
        firm_dbg_set_mask(dbg, SET_LEVEL_2);
+#endif /* DEBUG_libfirm */
 
        DB((dbg, LEVEL_1, "--------------------------------\n"
                "x87 Simulator started for %+F\n", irg));
@@ -1128,10 +1124,10 @@ void x87_simulate_graph(const arch_env_t *env, ir_graph *irg, ir_node **blk_list
        x87_simulator sim;
        int i;
 
-  /* we need liveness info for the current graph */
+       /* we need liveness info for the current graph */
        be_liveness(irg);
 
-  /* create the simulator */
+       /* create the simulator */
        x87_init_simulator(&sim, irg, env);
 
        start_block = get_irg_start_block(irg);
@@ -1155,6 +1151,6 @@ void x87_simulate_graph(const arch_env_t *env, ir_graph *irg, ir_node **blk_list
                }
        } while (! pdeq_empty(worklist));
 
-  /* kill it */
+       /* kill it */
        x87_destroy_simulator(&sim);
 }