X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Fcgana.c;h=a0fa516ee9777d5c4b9c39865e2dc16758d1e39f;hb=3da5ed2598245b896255bc444aaa1768f6098cfe;hp=2fc3773595e78bcd3b83ee08cbc52d3ba428b2bf;hpb=cf946e20e9cac9f8e42e7a1fc93886a75db7a80c;p=libfirm diff --git a/ir/ana/cgana.c b/ir/ana/cgana.c index 2fc377359..a0fa516ee 100644 --- a/ir/ana/cgana.c +++ b/ir/ana/cgana.c @@ -163,8 +163,8 @@ static ir_entity ** get_impl_methods(ir_entity * method) */ static void sel_methods_walker(ir_node *node, void *env) { - pmap *ldname_map = env; ir_entity **arr; + (void)env; /* Call standard optimizations */ if (is_Sel(node)) { @@ -175,16 +175,7 @@ static void sel_methods_walker(ir_node *node, void *env) } } - /* replace SymConst(name)-operations by SymConst(ent) */ - if (is_SymConst(node)) { - if (get_SymConst_kind(node) == symconst_addr_name) { - pmap_entry *entry = pmap_find(ldname_map, get_SymConst_name(node)); - if (entry != NULL) { /* Method is declared in the compiled code */ - assert(!"There should not be a SymConst[addr_name] addressing a method with an implementation" - "in this compilation unit. Use a SymConst[addr_ent]."); - } - } - } else if (is_Sel(node) && is_Method_type(get_entity_type(get_Sel_entity(node)))) { + if (is_Sel(node) && is_Method_type(get_entity_type(get_Sel_entity(node)))) { ir_entity *ent = get_SymConst_entity(get_atomic_ent_value(get_Sel_entity(node))); if (!eset_contains(entities, ent)) { @@ -250,7 +241,7 @@ static void sel_methods_init(void) } } - all_irg_walk(sel_methods_walker, NULL, ldname_map); + all_irg_walk(sel_methods_walker, NULL, NULL); pmap_destroy(ldname_map); } @@ -586,8 +577,8 @@ static ir_entity **get_free_methods(int *length) add_method_address(ent, free_set); } tp = get_tls_type(); - for (i = get_struct_n_members(tp) - 1; i >= 0; --i) { - ent = get_struct_member(tp, i); + for (i = get_class_n_members(tp) - 1; i >= 0; --i) { + ent = get_class_member(tp, i); add_method_address(ent, free_set); } @@ -672,17 +663,14 @@ static void callee_ana_node(ir_node *node, eset *methods) call and ignore it completely. */ eset_insert(methods, unknown_entity); /* free method -> unknown */ break; - case iro_SymConst: - if (get_SymConst_kind(node) == symconst_addr_ent) { - ir_entity *ent = get_SymConst_entity(node); - assert(ent && is_method_entity(ent)); - eset_insert(methods, ent); - } else { - assert(get_SymConst_kind(node) == symconst_addr_name); - /* external method (because fix_symconst()!) */ - eset_insert(methods, unknown_entity); /* free method -> unknown */ - } + + case iro_SymConst: { + ir_entity *ent = get_SymConst_entity(node); + assert(ent && is_method_entity(ent)); + eset_insert(methods, ent); break; + } + case iro_Sel: /* polymorphic method */ for (i = get_Sel_n_methods(node) - 1; i >= 0; --i) {