* For statistics: A type containing statistic data of a phase object.
*/
typedef struct {
- unsigned node_slots; /**< The number of allocated node slots. */
- unsigned node_slots_used; /**< The number of used node slots, i.e. nodes that have node data. */
- unsigned node_map_bytes; /**< Number of used bytes for the node map. */
- unsigned overall_bytes; /**< Overall number of used bytes for the phase. */
+ size_t node_slots; /**< The number of allocated node slots. */
+ size_t node_slots_used; /**< The number of used node slots, i.e. nodes that have node data. */
+ size_t node_map_bytes; /**< Number of used bytes for the node map. */
+ size_t overall_bytes; /**< Overall number of used bytes for the phase. */
} phase_stat_t;
/**
* @param phase The phase.
* @param irn The irn.
*/
-static inline void phase_reinit_single_irn_data(ir_phase *phase, ir_node *irn)
+static inline void phase_reinit_single_irn_data(ir_phase *phase, ir_node *irn,
+ phase_irn_reinit *reinit)
{
int idx;
idx = get_irn_idx(irn);
if (phase->data_ptr[idx])
- phase->data_init(phase, irn, phase->data_ptr[idx]);
+ phase->data_ptr[idx] = reinit(phase, irn, phase->data_ptr[idx]);
}
/**
phase_irn_init *data_init = ph->data_init;
/* call the node data structure allocator/constructor. */
- res = ph->data_ptr[idx] = data_init(ph, irn, NULL);
-
+ res = ph->data_ptr[idx] = data_init(ph, irn);
}
return res;
}
return res;
}
-
/**
* convenience function that returns phase information attached to a node
*/
/**
* Get or set information a phase holds about a node.
* If the given phase does not hold information of the node,
- * the information structure will be created, initialized (see the data_init function of ir_phase), and returned.
+ * the information structure will be created, initialized (see the data_init
+ * function of ir_phase), and returned.
* @param irn The node.
* @param id The ID of the phase.
*/
return phase_get_or_set_irn_data(ph, irn);
}
-static inline void *set_irn_phase_info(const ir_node *irn, ir_phase_id id, void *data)
+static inline void *set_irn_phase_info(const ir_node *irn, ir_phase_id id,
+ void *data)
{
const ir_graph *irg = get_irn_irg(irn);
ir_phase *ph = irg_get_phase(irg, id);
return phase_set_irn_data(ph, irn, data);
}
-
-
-
#endif