X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Ftype_t.h;h=b070c335febab29aedfdc19d0af3de3221c9700d;hb=e683a3e23ede57c176578db22c4a72050f101369;hp=b8e4d8d643c5345893ab9d18af04f8d691bd1253;hpb=a264fae9c118b272a26d1f636289873d6df14e39;p=libfirm diff --git a/ir/tr/type_t.h b/ir/tr/type_t.h index b8e4d8d64..b070c335f 100644 --- a/ir/tr/type_t.h +++ b/ir/tr/type_t.h @@ -1,4 +1,6 @@ +/* $Id$ */ + # ifndef _TYPE_T_H_ # define _TYPE_T_H_ @@ -23,6 +25,8 @@ typedef struct { entity **members; /* fields and methods of this class */ type **subtypes; /* direct subtypes */ type **supertypes; /* direct supertypes */ + peculiarity peculiarity; + int dfn; /* number used for 'instanceof' operator */ } cls_attr; typedef struct { @@ -52,9 +56,12 @@ typedef struct { typedef struct { int n_dimensions; /* Number of array dimensions. */ - int *lower_bound; /* Lower bounds of dimensions. Usually all 0. */ - int *upper_bound; /* Upper bounds or dimensions. */ + ir_node **lower_bound; /* Lower bounds of dimensions. Usually all 0. */ + ir_node **upper_bound; /* Upper bounds or dimensions. */ + int *order; /* Ordering of dimensions. */ type *element_type; /* The type of the array elements. */ + entity *element_ent; /* Entity for the array elements, to be used for + element selection with Sel. */ } arr_attr; typedef struct { @@ -70,10 +77,16 @@ typedef struct { } ptr_attr; /* -typedef struct { * No private attr yet. * -} pri_attr; +typedef struct { * No private attr yet! * +} pri_attr; */ + + +/* +typedef struct { * No private attr, must be smaller than others! * +} id_attr; */ + typedef union { cls_attr ca; stc_attr sa; @@ -87,12 +100,15 @@ typedef union { struct type { firm_kind kind; tp_op *type_op; - ir_mode *mode; ident *name; + type_state state; /* Represents the types state: layout undefined or + fixed. */ int size; /* Size of an entity of this type. This is determined when fixing the layout of this class. Size must be given in bytes. */ + ir_mode *mode; /* The mode for atomic types */ unsigned long visit; /* visited counter for walks of the type information */ + void *link; /* holds temporary data - like in irnode_t.h */ tp_attr attr; /* type kind specific fields. This must be the last entry in this struct! Varying size! */ }; @@ -104,17 +120,28 @@ struct type { * SYNOPSIS * type *new_type(tp_op *type_op, ir_mode *mode, ident* name); * INPUTS - * type_op - the kind of this type + * type_op - the kind of this type. May not be type_id. * mode - the mode to be used for this type, may be NULL * name - an ident for the name of this type. * RESULT * a new type of the given type. The remaining private attributes are not - * initalized. + * initalized. The type is in state layout_undefined. *** */ -inline type * +INLINE type * new_type(tp_op *type_op, ir_mode *mode, ident* name); +void free_type_attrs (type *tp); + +INLINE void free_class_attrs (type *clss); +INLINE void free_struct_attrs (type *strct); +INLINE void free_method_attrs (type *method); +INLINE void free_union_attrs (type *uni); +INLINE void free_array_attrs (type *array); +INLINE void free_enumeration_attrs(type *enumeration); +INLINE void free_pointer_attrs (type *pointer); +INLINE void free_primitive_attrs (type *primitive); + # endif /* _TYPE_T_H_ */