Initial version of the memory disambiguator added
[libfirm] / ir / ana / height.c
index 0e3d55c..469e422 100644 (file)
  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
  */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 
@@ -158,9 +162,8 @@ static unsigned compute_height(heights_t *h, ir_node *irn, const ir_node *bl)
        return ih->height;
 }
 
-static unsigned compute_heights_in_block(ir_node *bl, void *data)
+static unsigned compute_heights_in_block(ir_node *bl, heights_t *h)
 {
-       heights_t       *h         = data;
        int             max_height = -1;
        const ir_edge_t *edge;
 
@@ -183,6 +186,12 @@ static unsigned compute_heights_in_block(ir_node *bl, void *data)
        return max_height;
 }
 
+static void compute_heights_in_block_walker(ir_node *block, void *data)
+{
+       heights_t *h = data;
+       compute_heights_in_block(block, h);
+}
+
 unsigned get_irn_height(heights_t *heights, const ir_node *irn)
 {
        irn_height_t *h = phase_get_irn_data(&heights->ph, irn);
@@ -213,7 +222,7 @@ void heights_recompute(heights_t *h)
        edges_assure(phase_get_irg(&h->ph));
        phase_reinit_irn_data(&h->ph);
        h->visited = 0;
-       irg_block_walk_graph(phase_get_irg(&h->ph), compute_heights_in_block, NULL, h);
+       irg_block_walk_graph(phase_get_irg(&h->ph), compute_heights_in_block_walker, NULL, h);
 }
 
 heights_t *heights_new(ir_graph *irg)