*/
# include "type.h"
+# include "irprog.h" /* So that constructors can add the type to global
+ data structure. */
unsigned long type_visited = 0;
type_class *res;
res = (type_class *) xmalloc (sizeof (type_class));
+ add_irp_type((type *) res); /* Remember the new type global. */
res->kind = k_type_class;
res->name = name;
type_strct *res;
res = (type_strct *) xmalloc (sizeof (type_strct));
+ add_irp_type((type *) res); /* Remember the new type global. */
res->kind = k_type_strct;
res->name = name;
type_method *res;
res = (type_method *) xmalloc (sizeof (type_method));
+ add_irp_type((type *) res); /* Remember the new type global. */
res->kind = k_type_method;
res->name = name; // do I need the name, or is the name in entity sufficient?
res->arity = arity;
type_union *res;
res = (type_union *) xmalloc (sizeof (type_union));
+ add_irp_type((type *) res); /* Remember the new type global. */
res->kind = k_type_union;
res->name = name; // do I need a name?
res->n_types = n_types;
type_array *res;
res = (type_array *) xmalloc (sizeof (type_array));
+ add_irp_type((type *) res); /* Remember the new type global. */
res->kind = k_type_array;
res->name = name;
res->n_dimensions = n_dimensions;
type_enumeration *res;
res = (type_enumeration *) xmalloc (sizeof (type_enumeration));
+ add_irp_type((type *) res); /* Remember the new type global. */
res->kind = k_type_enumeration;
res->name = name;
/*
type_pointer *res;
res = (type_pointer *) xmalloc (sizeof (type_pointer));
+ add_irp_type((type *) res); /* Remember the new type global. */
res->kind = k_type_pointer;
res->name = name;
res->points_to = points_to;
type_primitive *res;
res = (type_primitive *) xmalloc (sizeof (type_primitive));
+ add_irp_type((type *) res); /* Remember the new type global. */
res->kind = k_type_primitive;
res->name = name;
res->mode = mode;