{
if (is_Block(bl)) {
be_lv_t *lv = (be_lv_t*)context;
- be_lv_info_t *info = (be_lv_info_t*)ir_nodehashmap_get(&lv->map, bl);
+ be_lv_info_t *info = ir_nodehashmap_get(be_lv_info_t, &lv->map, bl);
fprintf(F, "liveness:\n");
if (info != NULL) {
be_lv_info_node_t *res = NULL;
stat_ev_tim_push();
- irn_live = (be_lv_info_t*)ir_nodehashmap_get(&li->map, bl);
+ irn_live = ir_nodehashmap_get(be_lv_info_t, &li->map, bl);
if (irn_live != NULL) {
unsigned idx = get_irn_idx(irn);
static be_lv_info_node_t *be_lv_get_or_set(be_lv_t *li, ir_node *bl,
ir_node *irn)
{
- be_lv_info_t *irn_live = (be_lv_info_t*)ir_nodehashmap_get(&li->map, bl);
+ be_lv_info_t *irn_live = ir_nodehashmap_get(be_lv_info_t, &li->map, bl);
if (irn_live == NULL) {
irn_live = OALLOCNZ(&li->obst, be_lv_info_t, LV_STD_SIZE);
irn_live[0].head.n_size = LV_STD_SIZE-1;
static int be_lv_remove(be_lv_t *li, const ir_node *bl,
const ir_node *irn)
{
- be_lv_info_t *irn_live = (be_lv_info_t*)ir_nodehashmap_get(&li->map, bl);
+ be_lv_info_t *irn_live = ir_nodehashmap_get(be_lv_info_t, &li->map, bl);
if (irn_live != NULL) {
unsigned n = irn_live[0].head.n_members;
static inline int _be_lv_next_irn(const be_lv_t *lv, const ir_node *block,
unsigned flags, int i)
{
- be_lv_info_t *arr = (be_lv_info_t*)ir_nodehashmap_get(&lv->map, block);
+ be_lv_info_t *arr = ir_nodehashmap_get(be_lv_info_t, &lv->map, block);
if (arr != NULL) {
int n_members = (int) arr[0].head.n_members;
while(i < n_members) {
static inline ir_node *_be_lv_get_irn(const be_lv_t *lv, const ir_node *block,
int i)
{
- be_lv_info_t *arr = (be_lv_info_t*)ir_nodehashmap_get(&lv->map, block);
+ be_lv_info_t *arr = ir_nodehashmap_get(be_lv_info_t, &lv->map, block);
return get_idx_irn(lv->irg, arr[i + 1].node.idx);
}
sched_add_after(skip_Proj(irn), keep);
/* insert the other different and its copies into the map */
- entry = (op_copy_assoc_t*)ir_nodehashmap_get(op_set, other_different);
+ entry = ir_nodehashmap_get(op_copy_assoc_t, op_set, other_different);
if (! entry) {
entry = OALLOC(&env->obst, op_copy_assoc_t);
entry->cls = cls;
static inline spill_info_t *get_spill_info(minibelady_env_t *env, const ir_node *node)
{
- spill_info_t *spill_info
- = (spill_info_t*) ir_nodehashmap_get(&env->spill_infos, node);
+ spill_info_t *spill_info = ir_nodehashmap_get(spill_info_t, &env->spill_infos, node);
//ir_fprintf(stderr, "Get %+F -> %p\n", node, spill_info);
return spill_info;
}
be_lv_t *lv = w->lv;
be_lv_t *fresh = (be_lv_t*)w->data;
- be_lv_info_t *curr = (be_lv_info_t*)ir_nodehashmap_get(&fresh->map, bl);
- be_lv_info_t *fr = (be_lv_info_t*)ir_nodehashmap_get(&fresh->map, bl);
+ be_lv_info_t *curr = ir_nodehashmap_get(be_lv_info_t, &fresh->map, bl);
+ be_lv_info_t *fr = ir_nodehashmap_get(be_lv_info_t, &fresh->map, bl);
if (!fr && curr && curr[0].head.n_members > 0) {
unsigned i;
ir_nodehashmap_init_size(nodehashmap, 16);
}
-void *ir_nodehashmap_get(const ir_nodehashmap_t *self, const ir_node *node)
+void *(ir_nodehashmap_get)(const ir_nodehashmap_t *self, const ir_node *node)
{
ir_nodehashmap_entry_t *entry = ir_nodehashmap_find_(self, node);
return entry->data;
void *ir_nodehashmap_get(const ir_nodehashmap_t *nodehashmap,
const ir_node *node);
+#define ir_nodehashmap_get(type, self, node) ((type*)ir_nodehashmap_get((self), (node)))
+
/**
* Returns the number of pointers contained in the nodehashmap
*
static bool get_block_flag(const ir_nodehashmap_t *infos, const ir_node *block,
int flag)
{
- return PTR_TO_INT(ir_nodehashmap_get(infos, block)) & flag;
+ return PTR_TO_INT(ir_nodehashmap_get(void, infos, block)) & flag;
}
static void set_block_flag(ir_nodehashmap_t *infos, ir_node *block,
block_flags_t flag)
{
- int data = PTR_TO_INT(ir_nodehashmap_get(infos, block));
+ int data = PTR_TO_INT(ir_nodehashmap_get(void, infos, block));
data |= flag;
ir_nodehashmap_insert(infos, block, INT_TO_PTR(data));
}
return node;
bi = get_block_info(block);
- trans = (ir_node *)ir_nodehashmap_get(bi->trans, node);
+ trans = ir_nodehashmap_get(ir_node, bi->trans, node);
return trans;
}
*/
static node_entry *get_irn_ne(ir_node *irn, loop_env *env)
{
- node_entry *e = (node_entry*)ir_nodehashmap_get(&env->map, irn);
+ node_entry *e = ir_nodehashmap_get(node_entry, &env->map, irn);
if (e == NULL) {
e = OALLOC(&env->obst, node_entry);
goto restart;
}
- entry = (address_entry*)ir_nodehashmap_get(&env.adr_map, adr);
+ entry = ir_nodehashmap_get(address_entry, &env.adr_map, adr);
if (entry == NULL) {
/* new address */