X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fopt_polymorphy.c;h=a0902b70642c4dfee4bb5288ec3a5c01eb00dbdc;hb=e0e9e9ace61d3ec46e4d09c7ab2c6947b17b2778;hp=a26813614b37fb7606913fc4d13139e403851260;hpb=36fe2ec7872ae05dd67c9159be2f802383dc06d2;p=libfirm diff --git a/ir/opt/opt_polymorphy.c b/ir/opt/opt_polymorphy.c index a26813614..a0902b706 100644 --- a/ir/opt/opt_polymorphy.c +++ b/ir/opt/opt_polymorphy.c @@ -22,12 +22,10 @@ * @brief Optimize polymorphic Sel and Load nodes. * @author Goetz Lindenmaier, Michael Beck * @version $Id$ - * @summary + * @brief * This file subsumes optimization code from cgana. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "iroptimize.h" #include "irprog_t.h" @@ -55,8 +53,6 @@ ir_type *default_firm_get_Alloc(ir_node *n) { return NULL; } -typedef ir_type *(*get_Alloc_func)(ir_node *n); - /** The get_Alloc function */ static get_Alloc_func firm_get_Alloc = default_firm_get_Alloc; @@ -102,7 +98,8 @@ static ir_type *get_dynamic_type(ir_node *ptr) { /** * Check, if an entity is final, i.e. is not anymore overridden. */ -static int is_final_ent(ir_entity *ent) { +static int is_final_ent(ir_entity *ent) +{ if (is_entity_final(ent)) { /* not possible to override this entity. */ return 1; @@ -159,8 +156,6 @@ ir_node *transform_node_Sel(ir_node *node) { /* We know which method will be called, no dispatch necessary. */ called_ent = resolve_ent_polymorphy(dyn_tp, ent); - /* called_ent may not be description: has no Address/Const to Call! */ - assert(get_entity_peculiarity(called_ent) != peculiarity_description); rem_block = get_cur_block(); set_cur_block(get_nodes_block(node)); @@ -196,8 +191,7 @@ ir_node *transform_polymorph_Load(ir_node *load) { if (! is_Sel(field_ptr)) return load; ent = get_Sel_entity(field_ptr); - if ((get_entity_allocation(ent) != allocation_static) || - (get_entity_variability(ent) != variability_constant) ) + if ( !(get_entity_linkage(ent) & IR_LINKAGE_CONSTANT) ) return load; /* If the entity is a leave in the inheritance tree, @@ -214,8 +208,6 @@ ir_node *transform_polymorph_Load(ir_node *load) { /* We know which method will be called, no dispatch necessary. */ loaded_ent = resolve_ent_polymorphy(dyn_tp, ent); - /* called_ent may not be description: has no Address/Const to Call! */ - assert(get_entity_peculiarity(loaded_ent) != peculiarity_description); new_node = get_atomic_ent_value(loaded_ent); } }