Some access routines for visited flags in entity.h, irnode.h,
[libfirm] / ir / tr / type_t.h
index 61f1ee7..0855da3 100644 (file)
@@ -1,4 +1,6 @@
 
+/* $Id$ */
+
 # ifndef _TYPE_T_H_
 # define _TYPE_T_H_
 
@@ -52,8 +54,8 @@ 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. */
   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. */
@@ -76,6 +78,12 @@ 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;
@@ -91,10 +99,13 @@ struct type {
   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. */
   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! */
 };
@@ -106,17 +117,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 *
 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_ */