X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fircgopt.c;h=0c40a5bbc126a8f32b6278fd8beb2e3a67304015;hb=151f1b110fe2c1ead4ae8dd66a2521f35c324946;hp=5af9d7fdeed29f9df01c3e7a3d35d2503ff6486a;hpb=4eccb33ba0d66dc1077cd5ce405ecc6d8a914d78;p=libfirm diff --git a/ir/opt/ircgopt.c b/ir/opt/ircgopt.c index 5af9d7fde..0c40a5bbc 100644 --- a/ir/opt/ircgopt.c +++ b/ir/opt/ircgopt.c @@ -30,9 +30,7 @@ * der nicht erreichbaren Methoden wird aus der Abschätzung der * Aufrufrelation bestimmt. */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include "ircgopt.h" @@ -59,9 +57,13 @@ static void collect_call(ir_node *node, void *env) { } } -static void make_entity_to_description(type_or_ent *tore, void *env) { - if (get_kind(tore) == k_entity) { - ir_entity *ent = (ir_entity *)tore; +/** + * Type walker, set the peculiarity of entities which graphs + * gets removed to peculiarity_description. + */ +static void make_entity_to_description(type_or_ent tore, void *env) { + if (is_entity(tore.ent)) { + ir_entity *ent = tore.ent; if ((is_Method_type(get_entity_type(ent))) && (get_entity_peculiarity(ent) != peculiarity_description) && @@ -104,7 +106,7 @@ void gc_irgs(int n_keep, ir_entity ** keep_arr) { ir_node *node = get_irg_end(irg); /* collect calls */ - set_using_irn_link(irg); + ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK); irg_walk_graph(irg, firm_clear_link, collect_call, node); /* iterate calls */ @@ -124,7 +126,7 @@ void gc_irgs(int n_keep, ir_entity ** keep_arr) { } } } - clear_using_irn_link(irg); + ir_free_resources(irg, IR_RESOURCE_IRN_LINK); } } DEL_ARR_F(marked); @@ -141,10 +143,10 @@ void gc_irgs(int n_keep, ir_entity ** keep_arr) { free_loop_information(irg); } if ((get_entity_visibility(ent) == visibility_local) && (get_entity_link(ent) != MARK)) { - remove_irp_irg(irg); - set_entity_peculiarity(ent, peculiarity_description); DB((dbg, LEVEL_1, " freeing method %+F\n", ent)); + remove_irp_irg(irg); + set_entity_peculiarity(ent, peculiarity_description); } set_entity_link(ent, NULL); }