X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Fentity.c;h=031f9d48a697a33b4990454405c1da1a1c6b6a88;hb=79e991959fc8aee13e1b1d92220bde34a22afd92;hp=7cca358b8aecdbe5b6f0f65d868c20f4e7eef05a;hpb=e26e575fb98ad809bc9c161a347cecbe0f4caf90;p=libfirm diff --git a/ir/tr/entity.c b/ir/tr/entity.c index 7cca358b8..031f9d48a 100644 --- a/ir/tr/entity.c +++ b/ir/tr/entity.c @@ -82,10 +82,12 @@ new_entity (type *owner, ident *name, type *type) res->visibility = visibility_local; res->offset = -1; if (is_method_type(type)) { + symconst_symbol sym; + sym.entity_p = res; res->variability = variability_constant; rem = current_ir_graph; current_ir_graph = get_const_code_irg(); - res->value = new_Const(mode_P_mach, new_tarval_from_entity(res, mode_P_mach)); + res->value = new_SymConst(sym, symconst_addr_ent); current_ir_graph = rem; } else { res->variability = variability_uninitialized; @@ -488,7 +490,9 @@ ir_node *copy_const_value(ir_node *n) { case iro_Const: nn = new_Const(m, get_Const_tarval(n)); break; case iro_SymConst: - nn = new_SymConst(get_SymConst_type_or_id(n), get_SymConst_kind(n)); break; + + nn = new_SymConst(get_SymConst_type_or_id(n), get_SymConst_kind(n)); + break; case iro_Add: nn = new_Add(copy_const_value(get_Add_left(n)), copy_const_value(get_Add_right(n)), m); break; @@ -924,9 +928,11 @@ static entity *resolve_ent_polymorphy2 (type *dynamic_class, entity* static_ent) return res; } -/* Returns the dynamically referenced entity if the static entity and the - * dynamic type are given. - * Search downwards in overwritten tree. */ +/** Resolve polymorphy in the inheritance relation. + * + * Returns the dynamically referenced entity if the static entity and the + * dynamic type are given. + * Search downwards in overwritten tree. */ entity *resolve_ent_polymorphy(type *dynamic_class, entity* static_ent) { entity *res; assert(static_ent && static_ent->kind == k_entity); @@ -939,7 +945,6 @@ entity *resolve_ent_polymorphy(type *dynamic_class, entity* static_ent) { dump_entity(static_ent); dump_type(get_entity_owner(static_ent)); dump_type(dynamic_class); - } assert(res); return res;