X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firprog.c;h=963ae93e0eaa904b8a5369b226ad6d38c566418a;hb=2da89aec2e7d54d70940cccfa82f74c83e5221eb;hp=f7355f248957d66dbcc2f9f6bc8873aa4328c16f;hpb=d61b4fcf547abba70184af32e2d3acc77531c623;p=libfirm diff --git a/ir/ir/irprog.c b/ir/ir/irprog.c index f7355f248..963ae93e0 100644 --- a/ir/ir/irprog.c +++ b/ir/ir/irprog.c @@ -6,9 +6,14 @@ ** irprog.c: ir representation of a program */ +#ifdef HAVE_CONFIG_H +# include +#endif + # include "irprog_t.h" # include "array.h" # include "obst.h" +# include "typegmod.h" #define GLOBAL_TYPE_NAME "GlobalType" @@ -56,9 +61,9 @@ void set_irp_main_irg(ir_graph *main_irg) { irp->main_irg = main_irg; } -type_class *get_glob_type(void) { +type *get_glob_type(void) { assert(irp); - return irp->glob_type; + return irp->glob_type = skip_tid(irp->glob_type); } /* Adds irg to the list of ir graphs in irp. */ @@ -103,8 +108,8 @@ int get_irp_n_types (void) { type *get_irp_type(int pos) { assert (irp && irp->types); /* Strangely the first element of the array is NULL. Why?? */ - return irp->types[pos+1]; - + /* Don't set the skip_tid result so that no double entries are generated. */ + return skip_tid(irp->types[pos+1]); } void set_irp_type(int pos, type *typ) { @@ -112,7 +117,6 @@ void set_irp_type(int pos, type *typ) { assert (pos < (ARR_LEN((irp)->types) - 1)); /* Strangely the first element of the array is NULL. Why?? */ irp->types[pos+1] = typ; - } #ifdef DEBUG_libfirm