X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Ftype_t.h;h=660fb24f2e48ea254fd3276591e738e7f7e5278d;hb=5c34afb830f4a9233b659c95a9f71643f8421f86;hp=13818ed423fcd1c91989bf96bcb9d1079281744c;hpb=b7a0d752833eb7fb294ce90a27cbe01d06bbbc50;p=libfirm diff --git a/ir/tr/type_t.h b/ir/tr/type_t.h index 13818ed42..660fb24f2 100644 --- a/ir/tr/type_t.h +++ b/ir/tr/type_t.h @@ -27,6 +27,7 @@ #ifndef FIRM_TR_TYPE_T_H #define FIRM_TR_TYPE_T_H +#include #include "typerep.h" #include "tpop_t.h" #include "irgraph.h" @@ -69,12 +70,12 @@ typedef struct { typedef struct { size_t n_params; /**< Number of parameters. */ tp_ent_pair *params; /**< Array of parameter type/value entities pairs. */ - ir_type *value_params; /**< A type whose entities represent copied value arguments. */ size_t n_res; /**< Number of results. */ tp_ent_pair *res_type; /**< Array of result type/value ir_entity pairs. */ ir_variadicity variadicity; /**< The variadicity of the method. */ -mtp_additional_properties additional_properties; /**< Set of additional method properties. */ + mtp_additional_properties additional_properties; /**< Set of additional method properties. */ unsigned irg_calling_conv; /**< A set of calling convention flags. */ + bool has_compound_ret_parameter : 1; /**< first parameter compound return address */ } mtd_attr; /** Union type attributes. */ @@ -87,7 +88,7 @@ typedef struct { size_t n_dimensions; /**< Number of array 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. */ + size_t *order; /**< Ordering of dimensions. */ ir_type *element_type; /**< The type of the array elements. */ ir_entity *element_ent; /**< entity for the array elements, to be used for element selection with a Sel node. */ @@ -130,17 +131,17 @@ typedef union { /** Additional type flags. */ enum type_flags { - tf_none = 0, /**< No flags. */ - tf_lowered_type = 1, /**< Set if this is a lowered type. */ - tf_layout_fixed = 2, /**< Set if the layout of a type is fixed */ - - tf_frame_type = 4, /**< Set if this is a frame type. */ - tf_value_param_type = 8, /**< Set if this is a value param type. */ - tf_global_type = 16, /**< Set only for the global type */ - tf_tls_type = 32, /**< Set only for the tls type */ - tf_constructors = 64, /**< Set only for the constructors segment type */ - tf_destructors = 128, /**< Set only for the destructors segment type */ + 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_global_type = 1U << 3, /**< Set only for the global type */ + tf_tls_type = 1U << 4, /**< Set only for the tls type */ + tf_constructors = 1U << 5, /**< Set only for the constructors segment type */ + tf_destructors = 1U << 6, /**< Set only for the destructors segment type */ }; +ENUM_BITSET(type_flags) /** * An abstract data type to represent types. @@ -308,6 +309,28 @@ static inline void _set_master_type_visited(ir_visited_t val) { firm_type_visite static inline ir_visited_t _get_master_type_visited(void) { return firm_type_visited; } static inline void _inc_master_type_visited(void) { ++firm_type_visited; } +static inline int is_lowered_type(const ir_type *tp) +{ + return tp->flags & tf_lowered_type; +} + +/** + * Gets the lowered/unlowered type of a type or NULL if this type + * has no lowered/unlowered one. + */ +static inline ir_type *get_associated_type(const ir_type *tp) +{ + return tp->assoc_type; +} + +static inline void set_lowered_type(ir_type *tp, ir_type *lowered_type) +{ + assert (is_type(tp) && is_type(lowered_type)); + lowered_type->flags |= tf_lowered_type; + tp->assoc_type = lowered_type; + lowered_type->assoc_type = tp; +} + static inline void *_get_type_link(const ir_type *tp) { assert(tp && tp->kind == k_type);