** irprog.c: ir representation of a program
*/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
# include "irprog_t.h"
# include "array.h"
# include "obst.h"
+# include "typegmod.h"
#define GLOBAL_TYPE_NAME "GlobalType"
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. */
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) {
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