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 type *value_params; /**< A type whose entities represent copied value arguments. */
41 int n_res; /**< number of results */
42 type **res_type; /**< array with result types */
43 type *value_ress; /**< A type whose entities represent copied value results. */
44 variadicity variadicity; /**< variadicity of the method */
47 /** union attributs */
50 /* type **unioned_type; * a list of unioned types. */
51 /* ident **delim_names; * names of the union delimiters. */
52 entity **members; /**< fields of this union. No method entities
57 /** array attributs */
59 int n_dimensions; /**< Number of array dimensions. */
60 ir_node **lower_bound; /**< Lower bounds of dimensions. Usually all 0. */
61 ir_node **upper_bound; /**< Upper bounds or dimensions. */
62 int *order; /**< Ordering of dimensions. */
63 type *element_type; /**< The type of the array elements. */
64 entity *element_ent; /**< Entity for the array elements, to be used for
65 element selection with Sel. */
70 int n_enums; /**< Number of enumerators. */
71 tarval **enumer; /**< Contains all constants that represent a member
72 of the enum -- enumerators. */
73 ident **enum_nameid;/**< Contains the names of the enum fields as specified by
77 /** pointer attributs */
79 type *points_to; /**< The type of the enitity the pointer points to. */
83 typedef struct { * No private attr yet! *
88 typedef struct { * No private attr, must be smaller than others! *
92 /** general type attributs */
103 /** the structure of a type */
108 type_state state; /**< Represents the types state: layout undefined or
110 int size; /**< Size of an entity of this type. This is determined
111 when fixing the layout of this class. Size must be
113 ir_mode *mode; /**< The mode for atomic types */
114 unsigned long visit; /**< visited counter for walks of the type information */
115 void *link; /**< holds temporary data - like in irnode_t.h */
116 struct dbg_info* dbi; /**< A pointer to information for debug support. */
119 int nr; /**< a unique node number for each node to make output
122 tp_attr attr; /* type kind specific fields. This must be the last
123 entry in this struct! Varying size! */
127 * Creates a new type representation:
129 * @param type_op - the kind of this type. May not be type_id.
130 * @param mode - the mode to be used for this type, may be NULL
131 * @param name - an ident for the name of this type.
132 * @return a new type of the given type. The remaining private attributes are not
133 * @return initalized. The type is in state layout_undefined.
137 new_type(tp_op *type_op,
140 void free_type_attrs (type *tp);
142 INLINE void free_class_attrs (type *clss);
143 INLINE void free_struct_attrs (type *strct);
144 INLINE void free_method_attrs (type *method);
145 INLINE void free_union_attrs (type *uni);
146 INLINE void free_array_attrs (type *array);
147 INLINE void free_enumeration_attrs(type *enumeration);
148 INLINE void free_pointer_attrs (type *pointer);
149 INLINE void free_primitive_attrs (type *primitive);
152 /** initialize the type module */
153 void init_type (void);
155 # endif /* _TYPE_T_H_ */