static void *irn_height_init(ir_phase *phase, const ir_node *node)
{
- irn_height_t *h = phase_alloc(phase, sizeof(*h));
+ irn_height_t *h = (irn_height_t*) phase_alloc(phase, sizeof(*h));
(void) node;
memset(h, 0, sizeof(*h));
return h;
static void height_dump_cb(void *data, FILE *f, const ir_node *irn)
{
- ir_heights_t *heights = data;
- irn_height_t *h = phase_get_irn_data(&heights->phase, irn);
+ ir_heights_t *heights = (ir_heights_t*) data;
+ irn_height_t *h = (irn_height_t*) phase_get_irn_data(&heights->phase, irn);
if (h)
fprintf(f, "height: %u\n", h->height);
return false;
/* Check, if we have already been here. Coming more often won't help :-) */
- h_curr = phase_get_irn_data(&h->phase, curr);
+ h_curr = (irn_height_t*) phase_get_irn_data(&h->phase, curr);
if (h_curr->visited >= h->visited)
return false;
/* If we are too deep into the DAG we won't find the target either. */
- h_tgt = phase_get_irn_data(&h->phase, tgt);
+ h_tgt = (irn_height_t*) phase_get_irn_data(&h->phase, tgt);
if (h_curr->height > h_tgt->height)
return false;
const ir_node *m)
{
int res = 0;
- irn_height_t *hn = phase_get_irn_data(&h->phase, n);
- irn_height_t *hm = phase_get_irn_data(&h->phase, m);
+ irn_height_t *hn = (irn_height_t*) phase_get_irn_data(&h->phase, n);
+ irn_height_t *hm = (irn_height_t*) phase_get_irn_data(&h->phase, m);
assert(get_nodes_block(n) == get_nodes_block(m));
assert(hn != NULL && hm != NULL);
*/
static unsigned compute_height(ir_heights_t *h, ir_node *irn, const ir_node *bl)
{
- irn_height_t *ih = phase_get_or_set_irn_data(&h->phase, irn);
+ irn_height_t *ih = (irn_height_t*) phase_get_or_set_irn_data(&h->phase, irn);
const ir_edge_t *edge;
static void compute_heights_in_block_walker(ir_node *block, void *data)
{
- ir_heights_t *h = data;
+ ir_heights_t *h = (ir_heights_t*) data;
compute_heights_in_block(block, h);
}
unsigned get_irn_height(const ir_heights_t *heights, const ir_node *irn)
{
- const irn_height_t *h = phase_get_irn_data(&heights->phase, irn);
+ const irn_height_t *h = (irn_height_t*) phase_get_irn_data(&heights->phase, irn);
assert(h && "No height information for node");
return h->height;
}
/* reset phase data for all nodes in the block */
foreach_out_edge(block, edge) {
ir_node *irn = get_edge_src_irn(edge);
- irn_height_t *ih = phase_get_irn_data(&h->phase, irn);
+ irn_height_t *ih = (irn_height_t*) phase_get_irn_data(&h->phase, irn);
memset(ih, 0, sizeof(*ih));
}