X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Ftrvrfy.c;h=301ea9a90cb8498402352e3d49ba4092a9312c13;hb=288b414e4d82e0aa0d4b4348d8c387db02142cdb;hp=3196c676bf9978d28f1b5d5157add9d06922febb;hpb=1ce363f80e6a204d4011f85813362d9bd1d0e7e4;p=libfirm diff --git a/ir/tr/trvrfy.c b/ir/tr/trvrfy.c index 3196c676b..301ea9a90 100644 --- a/ir/tr/trvrfy.c +++ b/ir/tr/trvrfy.c @@ -24,9 +24,7 @@ * @author Michael Beck, Goetz Lindenmaier * @version $Id$ */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "irgraph_t.h" /* for checking whether constant code is allocated on proper obstack */ @@ -311,10 +309,12 @@ static int constants_on_wrong_irg(ir_entity *ent) { if (get_entity_variability(ent) == variability_uninitialized) return 0; if (is_compound_entity(ent)) { - int i; - for (i = get_compound_ent_n_values(ent) - 1; i >= 0; --i) { - if (constant_on_wrong_irg(get_compound_ent_value(ent, i))) - return 1; + if(!ent->has_initializer) { + int i; + for (i = get_compound_ent_n_values(ent) - 1; i >= 0; --i) { + if (constant_on_wrong_irg(get_compound_ent_value(ent, i))) + return 1; + } } } else { /* Might not be set if entity belongs to a description or is external allocated. */ @@ -415,14 +415,14 @@ int check_entity(ir_entity *ent) { /* * check types and entities */ -static void check_tore(type_or_ent *tore, void *env) { +static void check_tore(type_or_ent tore, void *env) { int *res = env; - assert(tore); - if (is_type(tore)) { - *res = check_type((ir_type *)tore); + assert(tore.ent); + if (is_type(tore.typ)) { + *res = check_type(tore.typ); } else { - assert(is_entity(tore)); - *res = check_entity((ir_entity *)tore); + assert(is_entity(tore.ent)); + *res = check_entity(tore.ent); } }