X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Ftype_finalization.c;h=3367d0a8a7867be3a62ee0200e71c1f0b45ba6fe;hb=a1fc5d2a5ed66510bbb2199ea5ee75416755cf1c;hp=e8f7ca44c91af51453c1833fb0488c70907d2a12;hpb=0fbcef83aa6060534172bb13e71cdadb04428806;p=libfirm diff --git a/ir/tr/type_finalization.c b/ir/tr/type_finalization.c index e8f7ca44c..3367d0a8a 100644 --- a/ir/tr/type_finalization.c +++ b/ir/tr/type_finalization.c @@ -34,8 +34,9 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg;) -static void do_finalization(type_or_ent tore, void *env) { - ir_type *glob_tp = env; +static void do_finalization(type_or_ent tore, void *env) +{ + ir_type *glob_tp = (ir_type*)env; if (is_type(tore.typ)) { ir_type *cls = tore.typ; @@ -47,10 +48,10 @@ static void do_finalization(type_or_ent tore, void *env) { return; if (get_class_n_subtypes(cls) == 0) { /* Note that we set the final property even for the - frame/tls types this way. Should not made any problems. */ + frame/global types this way. Should not made any problems. */ set_class_final(cls, 1); DB((dbg, LEVEL_1, " made final Class %s\n", - get_type_name(cls))); + get_class_name(cls))); } } else { ir_entity *ent = tore.ent; @@ -68,14 +69,14 @@ static void do_finalization(type_or_ent tore, void *env) { assert(get_entity_n_overwrittenby(ent) == 0); set_entity_final(ent, 1); DB((dbg, LEVEL_1, " made final %s::%s\n", - get_type_name(owner), get_entity_name(ent))); + get_compound_name(owner), get_entity_name(ent))); } else if (get_entity_n_overwrittenby(ent) == 0) { set_entity_final(ent, 1); DB((dbg, LEVEL_1, " made final %s::%s\n", - get_type_name(owner), get_entity_name(ent))); + get_compound_name(owner), get_entity_name(ent))); } } -} /* do_finalization */ +} /** * If we have the closed world assumption, we can calculate the @@ -83,12 +84,13 @@ static void do_finalization(type_or_ent tore, void *env) { * After this is done, all classes and entities that are not overridden * anymore have the final property set. */ -void types_calc_finalization(void) { - if (! get_opt_closed_world()) - return; +void types_calc_finalization(void) +{ + if (! get_opt_closed_world()) + return; FIRM_DBG_REGISTER(dbg, "firm.tr.finalization"); - /* types must be visited before it's entities */ + /* types must be visited before their entities */ type_walk(do_finalization, NULL, get_glob_type()); }