remove has_compound_ret_parameter, we already had cc_compound_ret
[libfirm] / ir / tr / type_t.h
index 598533d..41337cf 100644 (file)
@@ -27,6 +27,7 @@
 #ifndef FIRM_TR_TYPE_T_H
 #define FIRM_TR_TYPE_T_H
 
+#include <stdbool.h>
 #include "typerep.h"
 #include "tpop_t.h"
 #include "irgraph.h"
@@ -69,11 +70,10 @@ 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. */
 } mtd_attr;
 
@@ -87,7 +87,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 +130,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.
@@ -313,15 +313,12 @@ static inline int is_lowered_type(const ir_type *tp)
        return tp->flags & tf_lowered_type;
 }
 
-static inline ir_type *get_type_unlowered(const ir_type *tp)
-{
-       assert (is_lowered_type(tp));
-       return tp->assoc_type;
-}
-
-static inline ir_type *get_type_lowered(const ir_type *tp)
+/**
+ * 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)
 {
-       assert (tp->assoc_type == NULL || is_lowered_type(tp->assoc_type));
        return tp->assoc_type;
 }
 
@@ -329,10 +326,6 @@ 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;
-       /* there might be a chain of lowerings, get to the start */
-       while (is_lowered_type(tp)) {
-               tp = tp->assoc_type;
-       }
        tp->assoc_type = lowered_type;
        lowered_type->assoc_type = tp;
 }