#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"
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. */
/** 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.
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;
}
{
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;
}