Add a wrapper macro for pmap_get(), which has the return type as additional parameter.
authorChristoph Mallon <christoph.mallon@gmx.de>
Thu, 12 Jul 2012 10:57:15 +0000 (12:57 +0200)
committerChristoph Mallon <christoph.mallon@gmx.de>
Fri, 13 Jul 2012 21:03:54 +0000 (23:03 +0200)
27 files changed:
include/libfirm/adt/pmap.h
ir/adt/pmap.c
ir/ana/cdep.c
ir/ana/domfront.c
ir/ana/irmemory.c
ir/ana/irtypeinfo.c
ir/ana/trouts.c
ir/be/arm/arm_transform.c
ir/be/beabi.c
ir/be/bechordal.c
ir/be/bechordal_common.c
ir/be/bechordal_draw.c
ir/be/bechordal_t.h
ir/be/bedwarf.c
ir/be/begnuas.c
ir/be/ia32/ia32_common_transform.c
ir/be/ia32/ia32_x87.c
ir/be/sparc/sparc_transform.c
ir/ir/irdump.c
ir/ir/irio.c
ir/ir/irverify.c
ir/lower/lower_builtins.c
ir/lower/lower_calls.c
ir/lower/lower_dw.c
ir/lower/lower_intrinsics.c
ir/lower/lower_softfloat.c
ir/opt/opt_inline.c

index 6d3a347..d5a6e1e 100644 (file)
@@ -73,6 +73,8 @@ FIRM_API pmap_entry *pmap_find(pmap *map, const void * key);
 /** Returns the value of "key". */
 FIRM_API void * pmap_get(pmap *map, const void * key);
 
+#define pmap_get(type, map, key) ((type*)pmap_get(map, key))
+
 /** Return number of elements in the map */
 FIRM_API size_t pmap_count(pmap *map);
 
index 57b2671..6e0160f 100644 (file)
@@ -90,7 +90,7 @@ pmap_entry * pmap_find(pmap *map, const void *key)
 }
 
 
-void * pmap_get(pmap *map, const void *key)
+void * (pmap_get)(pmap *map, const void *key)
 {
        pmap_entry * entry = pmap_find(map, key);
        return entry == NULL ? NULL : entry->value;
index f7ad093..4517dff 100644 (file)
@@ -55,7 +55,7 @@ ir_cdep *(get_cdep_next)(const ir_cdep *cdep)
 ir_cdep *find_cdep(const ir_node *block)
 {
        assert(is_Block(block));
-       return (ir_cdep*) pmap_get(cdep_data->cdep_map, block);
+       return pmap_get(ir_cdep, cdep_data->cdep_map, block);
 }
 
 void exchange_cdep(ir_node *old, const ir_node *nw)
index 3865e0c..346df58 100644 (file)
@@ -129,5 +129,5 @@ ir_node **ir_get_dominance_frontier(const ir_node *block)
 {
        ir_graph            *irg  = get_irn_irg(block);
        ir_dom_front_info_t *info = &irg->domfront;
-       return (ir_node**)pmap_get(info->df_map, block);
+       return pmap_get(ir_node*, info->df_map, block);
 }
index 172d615..5989137 100644 (file)
@@ -1244,7 +1244,7 @@ static pmap *mtp_map;
  */
 static ir_type *clone_type_and_cache(ir_type *tp)
 {
-       ir_type *res = (ir_type*)pmap_get(mtp_map, tp);
+       ir_type *res = pmap_get(ir_type, mtp_map, tp);
 
        if (res == NULL) {
                res = clone_type_method(tp);
index 1d461b6..77b871e 100644 (file)
@@ -122,7 +122,7 @@ ir_type *get_irn_typeinfo_type(const ir_node *n)
        ir_type *res;
        assert(get_irg_typeinfo_state(get_irn_irg(n)) != ir_typeinfo_none);
 
-       res = (ir_type*)pmap_get(type_node_map, n);
+       res = pmap_get(ir_type, type_node_map, n);
        if (res == NULL) {
                res = initial_type;
        }
index d24b35b..d6aeddd 100644 (file)
@@ -57,7 +57,7 @@ static ir_node **get_entity_access_array(const ir_entity *ent)
        if (!entity_access_map) entity_access_map = pmap_create();
 
        if (pmap_contains(entity_access_map, ent)) {
-               res = (ir_node **) pmap_get(entity_access_map, ent);
+               res = pmap_get(ir_node*, entity_access_map, ent);
        } else {
                res = NEW_ARR_F(ir_node *, 0);
                pmap_insert(entity_access_map, ent, (void *)res);
@@ -81,7 +81,7 @@ static ir_node **get_entity_reference_array(const ir_entity *ent)
        if (!entity_reference_map) entity_reference_map = pmap_create();
 
        if (pmap_contains(entity_reference_map, ent)) {
-               res = (ir_node **) pmap_get(entity_reference_map, ent);
+               res = pmap_get(ir_node*, entity_reference_map, ent);
        } else {
                res = NEW_ARR_F(ir_node *, 0);
                pmap_insert(entity_reference_map, ent, (void *)res);
@@ -105,7 +105,7 @@ static ir_node **get_type_alloc_array(const ir_type *tp)
        if (!type_alloc_map) type_alloc_map = pmap_create();
 
        if (pmap_contains(type_alloc_map, tp)) {
-               res = (ir_node **) pmap_get(type_alloc_map, tp);
+               res = pmap_get(ir_node*, type_alloc_map, tp);
        } else {
                res = NEW_ARR_F(ir_node *, 0);
                pmap_insert(type_alloc_map, tp, (void *)res);
@@ -129,7 +129,7 @@ static ir_node **get_type_cast_array(const ir_type *tp)
        if (!type_cast_map) type_cast_map = pmap_create();
 
        if (pmap_contains(type_cast_map, tp)) {
-               res = (ir_node **) pmap_get(type_cast_map, tp);
+               res = pmap_get(ir_node*, type_cast_map, tp);
        } else {
                res = NEW_ARR_F(ir_node *, 0);
                pmap_insert(type_cast_map, tp, (void *)res);
@@ -152,7 +152,7 @@ static ir_type **get_type_pointertype_array(const ir_type *tp)
        if (!type_pointertype_map) type_pointertype_map = pmap_create();
 
        if (pmap_contains(type_pointertype_map, tp)) {
-               res = (ir_type **) pmap_get(type_pointertype_map, tp);
+               res = pmap_get(ir_type*, type_pointertype_map, tp);
        } else {
                res = NEW_ARR_F(ir_type *, 0);
                pmap_insert(type_pointertype_map, tp, (void *)res);
@@ -176,7 +176,7 @@ static ir_type **get_type_arraytype_array(const ir_type *tp)
        if (!type_arraytype_map) type_arraytype_map = pmap_create();
 
        if (pmap_contains(type_arraytype_map, tp)) {
-               res = (ir_type **) pmap_get(type_arraytype_map, tp);
+               res = pmap_get(ir_type*, type_arraytype_map, tp);
        } else {
                res = NEW_ARR_F(ir_type *, 0);
                pmap_insert(type_arraytype_map, tp, (void *)res);
index 48e3dc1..677118d 100644 (file)
@@ -1753,7 +1753,7 @@ static ir_node *get_stack_pointer_for(ir_node *node)
        }
 
        be_transform_node(stack_pred);
-       stack = (ir_node*)pmap_get(node_to_stack, stack_pred);
+       stack = pmap_get(ir_node, node_to_stack, stack_pred);
        if (stack == NULL) {
                return get_stack_pointer_for(stack_pred);
        }
index e734e7f..f5db9fe 100644 (file)
@@ -108,7 +108,7 @@ static int be_omit_fp = 1;
 
 static ir_node *be_abi_reg_map_get(pmap *map, const arch_register_t *reg)
 {
-       return (ir_node*)pmap_get(map, reg);
+       return pmap_get(ir_node, map, reg);
 }
 
 static void be_abi_reg_map_set(pmap *map, const arch_register_t* reg,
@@ -1229,7 +1229,7 @@ static ir_node *create_be_return(be_abi_irg_t *env, ir_node *irn, ir_node *bl,
        const arch_env_t *arch_env = be_get_irg_arch_env(irg);
        dbg_info *dbgi;
        pmap *reg_map  = pmap_create();
-       ir_node *keep  = (ir_node*)pmap_get(env->keep_map, bl);
+       ir_node *keep  = pmap_get(ir_node, env->keep_map, bl);
        size_t in_max;
        ir_node *ret;
        int i, n;
@@ -1580,7 +1580,7 @@ static void modify_irg(ir_graph *irg)
                        param_type = get_method_param_type(method_type, nr);
 
                        if (arg->in_reg) {
-                               repl = (ir_node*)pmap_get(env->regs, arg->reg);
+                               repl = pmap_get(ir_node, env->regs, arg->reg);
                        } else if (arg->on_stack) {
                                ir_node *addr = be_new_FrameAddr(sp->reg_class, start_bl, frame_pointer, arg->stack_ent);
 
@@ -1701,7 +1701,7 @@ static ir_entity *create_trampoline(be_main_env_t *be, ir_entity *method)
  */
 static ir_entity *get_trampoline(be_main_env_t *env, ir_entity *method)
 {
-       ir_entity *result = (ir_entity*)pmap_get(env->ent_trampoline_map, method);
+       ir_entity *result = pmap_get(ir_entity, env->ent_trampoline_map, method);
        if (result == NULL) {
                result = create_trampoline(env, method);
                pmap_insert(env->ent_trampoline_map, method, result);
@@ -1726,7 +1726,7 @@ static ir_entity *create_pic_symbol(be_main_env_t *be, ir_entity *entity)
 
 static ir_entity *get_pic_symbol(be_main_env_t *env, ir_entity *entity)
 {
-       ir_entity *result = (ir_entity*)pmap_get(env->ent_pic_symbol_map, entity);
+       ir_entity *result = pmap_get(ir_entity, env->ent_pic_symbol_map, entity);
        if (result == NULL) {
                result = create_pic_symbol(env, entity);
                pmap_insert(env->ent_pic_symbol_map, entity, result);
index 2219742..8f45e97 100644 (file)
@@ -332,7 +332,7 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env,
                        DBG((dbg, LEVEL_2, "\tsetting %+F to register %s\n", irn, reg->name));
                }
 
-               irn = (ir_node*)pmap_get(partners, alloc_nodes[i]);
+               irn = pmap_get(ir_node, partners, alloc_nodes[i]);
                if (irn != NULL) {
                        arch_set_irn_register(irn, reg);
                        (void) pset_hinsert_ptr(alloc_env->pre_colored, irn);
index 4146e60..fb7f1b0 100644 (file)
@@ -128,7 +128,7 @@ void create_borders(ir_node *block, void *env_ptr)
        /* Set up the border list in the block info */
        head = OALLOC(env->obst, struct list_head);
        INIT_LIST_HEAD(head);
-       assert(pmap_get(env->border_heads, block) == NULL);
+       assert(pmap_get(struct list_head, env->border_heads, block) == NULL);
        pmap_insert(env->border_heads, block, head);
 
        /*
index d502d94..4405f0d 100644 (file)
@@ -238,7 +238,7 @@ static void block_dims_walker(ir_node *block, void *data)
 static void layout(const draw_chordal_env_t *env, ir_node *bl, int x)
 {
        const draw_chordal_opts_t *opts   = env->opts;
-       struct block_dims         *dims   = (struct block_dims*)pmap_get(env->block_dims, bl);
+       struct block_dims         *dims   = pmap_get(struct block_dims, env->block_dims, bl);
        rect_t                    *rect   = &dims->subtree_box;
        int                       h_space = 0;
        int                       v_space = 0;
@@ -248,7 +248,7 @@ static void layout(const draw_chordal_env_t *env, ir_node *bl, int x)
        rect->x = x;
 
        dominates_for_each(bl, sub) {
-               struct block_dims *bl_dim = (struct block_dims*)pmap_get(env->block_dims, sub);
+               struct block_dims *bl_dim = pmap_get(struct block_dims, env->block_dims, sub);
 
                layout(env, sub, rect->x + rect->w);
 
@@ -270,12 +270,12 @@ static void layout(const draw_chordal_env_t *env, ir_node *bl, int x)
 static void set_y(const draw_chordal_env_t *env, ir_node *bl, int up)
 {
        const draw_chordal_opts_t *opts      = env->opts;
-       struct block_dims         *dims      = (struct block_dims*)pmap_get(env->block_dims, bl);
+       struct block_dims         *dims      = pmap_get(struct block_dims, env->block_dims, bl);
        int                       max_height = dims->subtree_box.h - dims->box.h - opts->v_gap;
        ir_node                   *sub;
 
        dominates_for_each(bl, sub) {
-               struct block_dims *bl_dim = (struct block_dims*)pmap_get(env->block_dims, sub);
+               struct block_dims *bl_dim = pmap_get(struct block_dims, env->block_dims, sub);
                int height_diff = max_height - bl_dim->subtree_box.h;
 
                set_y(env, sub, up + height_diff);
@@ -322,7 +322,7 @@ static void draw_block(ir_node *bl, void *data)
        struct list_head          *head    = get_block_border_head(env->chordal_env, bl);
        ir_node                   *dom     = get_Block_idom(bl);
        const draw_chordal_opts_t *opts    = env->opts;
-       struct block_dims         *dims    = (struct block_dims*)pmap_get(env->block_dims, bl);
+       struct block_dims         *dims    = pmap_get(struct block_dims, env->block_dims, bl);
        char                      buf[64];
        border_t                  *b;
        int                       idx;
@@ -361,7 +361,7 @@ static void draw_block(ir_node *bl, void *data)
        }
 
        if (dom) {
-               struct block_dims *dom_dims = (struct block_dims*)pmap_get(env->block_dims, dom);
+               struct block_dims *dom_dims = pmap_get(struct block_dims, env->block_dims, dom);
 
                be_lv_foreach(lv, bl, be_lv_state_in, idx) {
                        ir_node *irn = be_lv_get_irn(lv, bl, idx);
@@ -420,7 +420,7 @@ void draw_interval_tree(const draw_chordal_opts_t *opts,
        irg_block_walk_graph(chordal_env->irg, block_dims_walker, NULL, &env);
        layout(&env, start_block, opts->x_margin);
        set_y(&env, start_block, opts->y_margin);
-       start_dims = (struct block_dims*)pmap_get(env.block_dims, start_block);
+       start_dims = pmap_get(struct block_dims, env.block_dims, start_block);
        draw(&env, &start_dims->subtree_box);
 
        pmap_destroy(env.block_dims);
index 1aa74bd..c547675 100644 (file)
@@ -68,7 +68,7 @@ struct be_chordal_env_t {
 };
 
 static inline struct list_head *_get_block_border_head(const be_chordal_env_t *inf, ir_node *bl) {
-  return (list_head*)pmap_get(inf->border_heads, bl);
+  return pmap_get(list_head, inf->border_heads, bl);
 }
 
 #define get_block_border_head(info, bl)     _get_block_border_head(info, bl)
index 2de9f9d..cedf60f 100644 (file)
@@ -108,7 +108,7 @@ static char                 *comp_dir;
 static unsigned insert_file(const char *filename)
 {
        unsigned num;
-       void    *entry = pmap_get(env.file_map, filename);
+       void    *entry = pmap_get(void, env.file_map, filename);
        if (entry != NULL) {
                return PTR_TO_INT(entry);
        }
index 21711dd..89d852e 100644 (file)
@@ -1332,7 +1332,7 @@ void be_gas_emit_block_name(const ir_node *block)
        if (entity != NULL) {
                be_gas_emit_entity(entity);
        } else {
-               void *nr_val = pmap_get(block_numbers, block);
+               void *nr_val = pmap_get(void, block_numbers, block);
                int   nr;
                if (nr_val == NULL) {
                        nr = next_block_nr++;
index 61b9a0e..ba687c2 100644 (file)
@@ -75,7 +75,7 @@ ir_type *ia32_get_prim_type(const ir_mode *mode)
 ir_entity *ia32_create_float_const_entity(ia32_isa_t *isa, ir_tarval *tv,
                                           ident *name)
 {
-       ir_entity        *res = (ir_entity*)pmap_get(isa->tv_ent, tv);
+       ir_entity        *res = pmap_get(ir_entity, isa->tv_ent, tv);
        ir_initializer_t *initializer;
        ir_mode          *mode;
        ir_type          *tp;
index 6e39ccd..77b9bb2 100644 (file)
@@ -337,7 +337,7 @@ static void x87_emms(x87_state *state)
  */
 static blk_state *x87_get_bl_state(x87_simulator *sim, ir_node *block)
 {
-       blk_state *res = (blk_state*)pmap_get(sim->blk_states, block);
+       blk_state *res = pmap_get(blk_state, sim->blk_states, block);
 
        if (res == NULL) {
                res = OALLOC(&sim->obst, blk_state);
index b87792c..3d41326 100644 (file)
@@ -1105,7 +1105,7 @@ static ir_entity *create_float_const_entity(ir_tarval *tv)
 {
        const arch_env_t *arch_env = be_get_irg_arch_env(current_ir_graph);
        sparc_isa_t      *isa      = (sparc_isa_t*) arch_env;
-       ir_entity        *entity   = (ir_entity*) pmap_get(isa->constants, tv);
+       ir_entity        *entity   = pmap_get(ir_entity, isa->constants, tv);
        ir_initializer_t *initializer;
        ir_mode          *mode;
        ir_type          *type;
@@ -1642,7 +1642,7 @@ static ir_node *get_stack_pointer_for(ir_node *node)
        }
 
        be_transform_node(stack_pred);
-       stack = (ir_node*)pmap_get(node_to_stack, stack_pred);
+       stack = pmap_get(ir_node, node_to_stack, stack_pred);
        if (stack == NULL) {
                return get_stack_pointer_for(stack_pred);
        }
index 5702a84..5e59695 100644 (file)
@@ -474,7 +474,7 @@ static void *ird_get_irn_link(const ir_node *n)
                return NULL;
 
        if (pmap_contains(irdump_link_map, n))
-               res = pmap_get(irdump_link_map, n);
+               res = pmap_get(void, irdump_link_map, n);
        return res;
 }
 
@@ -498,7 +498,7 @@ static void *ird_get_irg_link(const ir_graph *irg)
                return NULL;
 
        if (pmap_contains(irdump_link_map, irg))
-               res = pmap_get(irdump_link_map, irg);
+               res = pmap_get(void, irdump_link_map, irg);
        return res;
 }
 
index 732752d..a61b080 100644 (file)
@@ -2187,20 +2187,20 @@ static ir_node *read_Anchor(read_env_t *env)
        return res;
 }
 
-typedef ir_node* (*read_node_func)(read_env_t *env);
+typedef ir_node* read_node_func(read_env_t *env);
 static pmap *node_readers;
 
-static void register_node_reader(ident *ident, read_node_func func)
+static void register_node_reader(ident *ident, read_node_func* func)
 {
        pmap_insert(node_readers, ident, (void*)func);
 }
 
 static ir_node *read_node(read_env_t *env)
 {
-       ident         *id   = read_symbol(env);
-       read_node_func func = (read_node_func)pmap_get(node_readers, id);
-       long           nr   = read_long(env);
-       ir_node       *res;
+       ident          *id   = read_symbol(env);
+       read_node_func *func = pmap_get(read_node_func, node_readers, id);
+       long            nr   = read_long(env);
+       ir_node        *res;
        if (func == NULL) {
                parse_error(env, "Unknown nodetype '%s'", get_id_str(id));
                skip_to(env, '\n');
index 48f08ec..727f5a1 100644 (file)
@@ -1891,7 +1891,7 @@ static int check_block_cfg(const ir_node *block, check_cfg_env_t *env)
                branch = skip_Tuple(branch);
                if (is_Bad(branch))
                        continue;
-               former_dest = (ir_node*)pmap_get(branch_nodes, branch);
+               former_dest = pmap_get(ir_node, branch_nodes, branch);
                ASSERT_AND_RET_DBG(former_dest==NULL || is_unknown_jump(skip_Proj(branch)),
                                                   "Multiple users on mode_X node", 0,
                                                   ir_printf("node %+F\n", branch);
@@ -1904,7 +1904,7 @@ static int check_block_cfg(const ir_node *block, check_cfg_env_t *env)
                if (is_Proj(branch)) {
                        branch = skip_Proj(branch);
                }
-               former_branch = (ir_node*)pmap_get(branch_nodes, branch_block);
+               former_branch = pmap_get(ir_node, branch_nodes, branch_block);
 
                ASSERT_AND_RET_DBG(former_branch == NULL || former_branch == branch,
                                                   "Multiple branching nodes in a block", 0,
@@ -1939,7 +1939,7 @@ static void check_cfg_walk_func(ir_node *node, void *data)
 
 static int verify_block_branch(const ir_node *block, check_cfg_env_t *env)
 {
-       ir_node *branch = (ir_node*)pmap_get(env->branch_nodes, block);
+       ir_node *branch = pmap_get(ir_node, env->branch_nodes, block);
        ASSERT_AND_RET_DBG(branch != NULL
                           || ir_nodeset_contains(&env->kept_nodes, block)
                           || block == get_irg_end_block(get_irn_irg(block)),
index 5109686..381ea97 100644 (file)
@@ -99,7 +99,7 @@ static void replace_with_call(ir_node *node)
        snprintf(buf, sizeof(buf), "__%s%s2", name, gcc_machmode);
        id = new_id_from_str(buf);
 
-       entity = (ir_entity*)pmap_get(entities, id);
+       entity = pmap_get(ir_entity, entities, id);
        if (entity == NULL) {
                entity = create_compilerlib_entity(id, mtp);
                pmap_insert(entities, id, entity);
index 8fc142f..7e6c6de 100644 (file)
@@ -51,7 +51,7 @@ static pmap *lowered_mtps;
  */
 static ir_type *get_pointer_type(ir_type *dest_type)
 {
-       ir_type *res = (ir_type*)pmap_get(pointer_types, dest_type);
+       ir_type *res = pmap_get(ir_type, pointer_types, dest_type);
        if (res == NULL) {
                res = new_type_pointer(dest_type);
                pmap_insert(pointer_types, dest_type, res);
@@ -119,7 +119,7 @@ static ir_type *lower_mtp(compound_call_lowering_flags flags, ir_type *mtp)
        if (!is_Method_type(mtp))
                return mtp;
 
-       lowered = (ir_type*)pmap_get(lowered_mtps, mtp);
+       lowered = pmap_get(ir_type, lowered_mtps, mtp);
        if (lowered != NULL)
                return lowered;
 
@@ -508,7 +508,7 @@ static ir_node *get_dummy_sel(ir_graph *irg, ir_node *block, ir_type *tp,
                               wlk_env *env)
 {
        /* use a map the check if we already create such an entity */
-       ir_entity *ent = (ir_entity*)pmap_get(env->dummy_map, tp);
+       ir_entity *ent = pmap_get(ir_entity, env->dummy_map, tp);
        if (ent == NULL) {
                ir_type *ft = get_irg_frame_type(irg);
                ident   *dummy_id = id_unique("dummy.%u");
index 83fcb4e..a2fbd99 100644 (file)
@@ -1739,7 +1739,7 @@ static ir_type *lower_mtp(ir_type *mtp)
        size_t   n_res;
        bool     must_be_lowered;
 
-       res = (ir_type*)pmap_get(lowered_type, mtp);
+       res = pmap_get(ir_type, lowered_type, mtp);
        if (res != NULL)
                return res;
        if (type_visited(mtp))
@@ -2377,7 +2377,7 @@ static ir_type *lower_Builtin_type_high(ir_type *mtp)
        size_t   n_results;
        bool     must_be_lowered;
 
-       res = (ir_type*)pmap_get(lowered_builtin_type_high, mtp);
+       res = pmap_get(ir_type, lowered_builtin_type_high, mtp);
        if (res != NULL)
                return res;
 
@@ -2473,7 +2473,7 @@ static ir_type *lower_Builtin_type_low(ir_type *mtp)
        size_t   n_results;
        bool     must_be_lowered;
 
-       res = (ir_type*)pmap_get(lowered_builtin_type_low, mtp);
+       res = pmap_get(ir_type, lowered_builtin_type_low, mtp);
        if (res != NULL)
                return res;
 
index 8b1ddf9..f11f39b 100644 (file)
@@ -70,7 +70,7 @@ static void call_mapper(ir_node *node, void *env)
                        return;
 
                ent = get_SymConst_entity(symconst);
-               r   = (const i_call_record*)pmap_get(wenv->c_map, ent);
+               r   = pmap_get(i_call_record const, wenv->c_map, ent);
 
                if (r != NULL) {
                        wenv->nr_of_intrinsics += r->i_mapper(node, r->ctx) ? 1 : 0;
index b353e9a..e967f56 100644 (file)
@@ -379,7 +379,7 @@ static ir_type *lower_method_type(ir_type *mtp)
        size_t   n_param;
        size_t   n_res;
 
-       res = (ir_type*)pmap_get(lowered_type, mtp);
+       res = pmap_get(ir_type, lowered_type, mtp);
        if (res != NULL)
                return res;
 
index c23694c..99f237d 100644 (file)
@@ -1084,7 +1084,7 @@ void inline_leaf_functions(unsigned maxsize, unsigned leafsize,
                                continue;
                        }
 
-                       calleee = (ir_graph*)pmap_get(copied_graphs, callee);
+                       calleee = pmap_get(ir_graph, copied_graphs, callee);
                        if (calleee != NULL) {
                                /*
                                 * Remap callee if we have a copy.
@@ -1607,7 +1607,7 @@ static void inline_into(ir_graph *irg, unsigned maxsize,
                        continue;
                }
 
-               calleee = (ir_graph*)pmap_get(copied_graphs, callee);
+               calleee = pmap_get(ir_graph, copied_graphs, callee);
                if (calleee != NULL) {
                        int benefice = curr_call->benefice;
                        /*