9 /****h* libfirm/type_t.h
14 * (C) 2001 by Universitaet Karlsruhe
18 * This file contains the datatypes hidden in type.h.
20 * type.h tpop_t.h tpop.h
25 entity **members; /* fields and methods of this class */
26 type **subtypes; /* direct subtypes */
27 type **supertypes; /* direct supertypes */
31 entity **members; /* fields of this struct. No method entities
36 int n_params; /* number of parameters */
37 type **param_type; /* code generation needs this information.
38 @@@ Should it be generated by the frontend,
39 or does this impose unnecessary work for
40 optimizations that change the parameters of
42 int n_res; /* number of results */
43 type **res_type; /* array with result types */
48 /* type **unioned_type; * a list of unioned types. */
49 /* ident **delim_names; * names of the union delimiters. */
50 entity **members; /* fields of this union. No method entities
56 int n_dimensions; /* Number of array dimensions. */
57 ir_node **lower_bound; /* Lower bounds of dimensions. Usually all 0. */
58 ir_node **upper_bound; /* Upper bounds or dimensions. */
59 type *element_type; /* The type of the array elements. */
60 entity *element_ent; /* Entity for the array elements, to be used for
61 element selection with Sel. */
65 int n_enums; /* Number of enumerators. */
66 tarval **enumer; /* Contains all constants that represent a member
67 of the enum -- enumerators. */
68 ident **enum_nameid;/* Contains the names of the enum fields as specified by
73 type *points_to; /* The type of the enitity the pointer points to. */
77 typedef struct { * No private attr yet. *
82 typedef struct { * No private attr, must be smaller than others! *
102 type_state state; /* Represents the types state: layout undefined or
104 int size; /* Size of an entity of this type. This is determined
105 when fixing the layout of this class. Size must be
107 unsigned long visit; /* visited counter for walks of the type information */
108 void *link; /* holds temporary data - like in irnode_t.h */
109 tp_attr attr; /* type kind specific fields. This must be the last
110 entry in this struct! Varying size! */
113 /****f* type_t.h/new_type
116 * new_type - creates a new type representation
118 * type *new_type(tp_op *type_op, ir_mode *mode, ident* name);
120 * type_op - the kind of this type. May not be type_id.
121 * mode - the mode to be used for this type, may be NULL
122 * name - an ident for the name of this type.
124 * a new type of the given type. The remaining private attributes are not
125 * initalized. The type is in state layout_undefined.
129 new_type(tp_op *type_op,
132 void free_type_attrs (type *tp);
134 inline void free_class_attrs (type *clss);
135 inline void free_struct_attrs (type *strct);
136 inline void free_method_attrs (type *method);
137 inline void free_union_attrs (type *uni);
138 inline void free_array_attrs (type *array);
139 inline void free_enumeration_attrs(type *enumeration);
140 inline void free_pointer_attrs (type *pointer);
141 inline void free_primitive_attrs (type *primitive);
144 # endif /* _TYPE_T_H_ */