2 * (C) 2001 by Universitaet Karlsruhe
15 * This file contains the datatypes hidden in type.h.
17 * @author Goetz Lindenmaier
18 * @see type.h tpop_t.h tpop.h
21 /** class attributes */
23 entity **members; /**< fields and methods of this class */
24 type **subtypes; /**< direct subtypes */
25 type **supertypes; /**< direct supertypes */
26 peculiarity peculiarity;
27 int dfn; /**< number used for 'instanceof' operator */
30 /** struct attributs */
32 entity **members; /**< fields of this struct. No method entities
36 /** method attributes */
38 int n_params; /**< number of parameters */
39 type **param_type; /**< code generation needs this information.
40 @@@ Should it be generated by the frontend,
41 or does this impose unnecessary work for
42 optimizations that change the parameters of
44 int n_res; /**< number of results */
45 type **res_type; /**< array with result types */
46 variadicity variadicity; /**< variadicity of the method */
49 /** union attributs */
52 /* type **unioned_type; * a list of unioned types. */
53 /* ident **delim_names; * names of the union delimiters. */
54 entity **members; /**< fields of this union. No method entities
59 /** array attributs */
61 int n_dimensions; /**< Number of array dimensions. */
62 ir_node **lower_bound; /**< Lower bounds of dimensions. Usually all 0. */
63 ir_node **upper_bound; /**< Upper bounds or dimensions. */
64 int *order; /**< Ordering of dimensions. */
65 type *element_type; /**< The type of the array elements. */
66 entity *element_ent; /**< Entity for the array elements, to be used for
67 element selection with Sel. */
72 int n_enums; /**< Number of enumerators. */
73 tarval **enumer; /**< Contains all constants that represent a member
74 of the enum -- enumerators. */
75 ident **enum_nameid;/**< Contains the names of the enum fields as specified by
79 /** pointer attributs */
81 type *points_to; /**< The type of the enitity the pointer points to. */
85 typedef struct { * No private attr yet! *
90 typedef struct { * No private attr, must be smaller than others! *
94 /** general type attributs */
105 /** the structure of a type */
110 type_state state; /**< Represents the types state: layout undefined or
112 int size; /**< Size of an entity of this type. This is determined
113 when fixing the layout of this class. Size must be
115 ir_mode *mode; /**< The mode for atomic types */
116 unsigned long visit; /**< visited counter for walks of the type information */
117 void *link; /**< holds temporary data - like in irnode_t.h */
118 struct dbg_info* dbi; /**< A pointer to information for debug support. */
121 int nr; /**< a unique node number for each node to make output
124 tp_attr attr; /* type kind specific fields. This must be the last
125 entry in this struct! Varying size! */
129 * Creates a new type representation:
131 * @param type_op - the kind of this type. May not be type_id.
132 * @param mode - the mode to be used for this type, may be NULL
133 * @param name - an ident for the name of this type.
134 * @return a new type of the given type. The remaining private attributes are not
135 * @return initalized. The type is in state layout_undefined.
139 new_type(tp_op *type_op,
142 void free_type_attrs (type *tp);
144 INLINE void free_class_attrs (type *clss);
145 INLINE void free_struct_attrs (type *strct);
146 INLINE void free_method_attrs (type *method);
147 INLINE void free_union_attrs (type *uni);
148 INLINE void free_array_attrs (type *array);
149 INLINE void free_enumeration_attrs(type *enumeration);
150 INLINE void free_pointer_attrs (type *pointer);
151 INLINE void free_primitive_attrs (type *primitive);
154 # endif /* _TYPE_T_H_ */