-/** the structure of a type */
-struct type {
- firm_kind kind; /**< the firm kind, must be k_type */
- const tp_op *type_op; /**< the type operation of the type */
- ident *name; /**< The name of the type */
- visibility visibility; /**< Visibility of entities of this type. */
- 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 bits. */
- int align; /**< Alignment of an entity of this type. This should be
- set according to the source language needs. If not set it's
- calculated automatically by get_type_alignment().
- Alignment must be given in bits. */
- 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 */
- struct dbg_info* dbi; /**< A pointer to information for debug support. */
-
- /* ------------- fields for analyses ---------------*/
+/** Additional type flags. */
+enum type_flags {
+ tf_none = 0, /**< No flags. */
+ tf_lowered_type = 1U << 0, /**< Set if this is a lowered type. */
+ tf_layout_fixed = 1U << 1, /**< Set if the layout of a type is fixed */
+
+ tf_frame_type = 1U << 2, /**< Set if this is a frame type. */
+ tf_segment = 1U << 3, /**< type represents a linker segment */
+ tf_global_type = 1U << 4, /**< Set only for the global type */
+ tf_tls_type = 1U << 5, /**< Set only for the tls type */
+ tf_constructors = 1U << 6, /**< Set only for the constructors segment type */
+ tf_destructors = 1U << 7, /**< Set only for the destructors segment type */
+ tf_variable_size = 1U << 8, /**< compound or array type may have variable size last element */
+};
+ENUM_BITSET(type_flags)
+
+/**
+ * An abstract data type to represent types.
+ *
+ * This is the abstract data type with which any type known in the
+ * compiled program can be represented. This includes types specified
+ * in the program as well as types defined by the language. In the
+ * view of the intermediate representation there is no difference
+ * between these types.
+ *
+ * There exist several kinds of types, arranged by the structure of
+ * the type. These are distinguished by a type opcode.
+ * A type is described by a set of attributes. Some of these attributes
+ * are common to all types, others depend on the kind of the type.
+ */
+struct ir_type {
+ firm_kind kind; /**< the firm kind, must be k_type */
+ const tp_op *type_op; /**< the type operation of the type */
+ ident *name; /**< The name of the type */
+ ir_visibility visibility;/**< Visibility of entities of this type. */
+ unsigned flags; /**< Type flags, a bitmask of enum type_flags. */
+ unsigned size; /**< Size of an ir_entity of this type. This is
+ determined when fixing the layout of this
+ class. Size must be given in bytes. */
+ unsigned align; /**< Alignment of an ir_entity of this type. This
+ should be set according to the source
+ language needs. If not set, it's calculated
+ automatically by get_type_alignment().
+ Alignment must be given in bytes. */
+ ir_mode *mode; /**< The mode for atomic types */
+ ir_visited_t visit; /**< visited counter for walks of the type information */
+ void *link; /**< holds temporary data - like in irnode_t.h */
+ type_dbg_info *dbi; /**< A pointer to information for debug support. */
+ ir_type *higher_type; /**< link to highlevel type in case of lowered
+ types */