X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Ftype_finalization.c;h=7b9f54e2b726da526ff66c32cee76f130ad58bc3;hb=70a04b0cc2c9efc3323b9ef1a6158c0ae1c88235;hp=d626897a6008f82e5aa9b55d75cf13c274ea667d;hpb=a75266e6f61b8b9ddeaaecdcb1665f35faa1a077;p=libfirm diff --git a/ir/tr/type_finalization.c b/ir/tr/type_finalization.c index d626897a6..7b9f54e2b 100644 --- a/ir/tr/type_finalization.c +++ b/ir/tr/type_finalization.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -22,11 +22,9 @@ * @brief Calculate finalization of classes and entities by * inspecting the class hierarchy. * @author Michael Beck - * @version $Id: $ + * @version $Id$ */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "typerep.h" #include "irprog_t.h" @@ -36,11 +34,12 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg;) -static void do_finalization(type_or_ent *tore, void *env) { +static void do_finalization(type_or_ent tore, void *env) +{ ir_type *glob_tp = env; - if (is_type(tore)) { - ir_type *cls = (ir_type *)tore; + if (is_type(tore.typ)) { + ir_type *cls = tore.typ; if (! is_Class_type(cls) || cls == glob_tp) return; @@ -49,13 +48,13 @@ 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 = (ir_entity *)tore; + ir_entity *ent = tore.ent; ir_type *owner; if (is_entity_final(ent)) @@ -70,11 +69,11 @@ 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 */ @@ -85,12 +84,12 @@ 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) { +void types_calc_finalization(void) +{ if (! get_opt_closed_world()) return; FIRM_DBG_REGISTER(dbg, "firm.tr.finalization"); -// firm_dbg_set_mask(dbg, SET_LEVEL_1); /* types must be visited before it's entities */ type_walk(do_finalization, NULL, get_glob_type());