7 /****h* libfirm/type_t.h
12 * (C) 2001 by Universitaet Karlsruhe
16 * This file contains the datatypes hidden in type.h.
18 * type.h tpop_t.h tpop.h
23 entity **members; /* fields and methods of this class */
24 type **subtypes; /* direct subtypes */
25 type **supertypes; /* direct supertypes */
29 entity **members; /* fields of this struct. No method entities
34 int n_params; /* number of parameters */
35 type **param_type; /* code generation needs this information.
36 @@@ Should it be generated by the frontend,
37 or does this impose unnecessary work for
38 optimizations that change the parameters of
40 int n_res; /* number of results */
41 type **res_type; /* array with result types */
46 /* type **unioned_type; * a list of unioned types. */
47 /* ident **delim_names; * names of the union delimiters. */
48 entity **members; /* fields of this union. No method entities
54 int n_dimensions; /* Number of array dimensions. */
55 ir_node **lower_bound; /* Lower bounds of dimensions. Usually all 0. */
56 ir_node **upper_bound; /* Upper bounds or dimensions. */
57 type *element_type; /* The type of the array elements. */
58 entity *element_ent; /* Entity for the array elements, to be used for
59 element selection with Sel. */
63 int n_enums; /* Number of enumerators. */
64 tarval **enumer; /* Contains all constants that represent a member
65 of the enum -- enumerators. */
66 ident **enum_nameid;/* Contains the names of the enum fields as specified by
71 type *points_to; /* The type of the enitity the pointer points to. */
75 typedef struct { * No private attr yet. *
80 typedef struct { * No private attr, must be smaller than others! *
100 type_state state; /* Represents the types state: layout undefined or
102 int size; /* Size of an entity of this type. This is determined
103 when fixing the layout of this class. Size must be
105 unsigned long visit; /* visited counter for walks of the type information */
106 tp_attr attr; /* type kind specific fields. This must be the last
107 entry in this struct! Varying size! */
110 /****f* type_t.h/new_type
113 * new_type - creates a new type representation
115 * type *new_type(tp_op *type_op, ir_mode *mode, ident* name);
117 * type_op - the kind of this type. May not be type_id.
118 * mode - the mode to be used for this type, may be NULL
119 * name - an ident for the name of this type.
121 * a new type of the given type. The remaining private attributes are not
122 * initalized. The type is in state layout_undefined.
126 new_type(tp_op *type_op,
129 void free_type_attrs (type *tp);
131 inline void free_class_attrs (type *clss);
132 inline void free_struct_attrs (type *strct);
133 inline void free_method_attrs (type *method);
134 inline void free_union_attrs (type *uni);
135 inline void free_array_attrs (type *array);
136 inline void free_enumeration_attrs(type *enumeration);
137 inline void free_pointer_attrs (type *pointer);
138 inline void free_primitive_attrs (type *primitive);
141 # endif /* _TYPE_T_H_ */