Remove type lower functions from API
[libfirm] / ir / tr / type_t.h
index 73c7c78..598533d 100644 (file)
@@ -61,9 +61,8 @@ typedef struct {
 
 /** A (type, ir_entity) pair. */
 typedef struct {
-       ir_type *tp;         /**< A type. */
-       ir_entity  *ent;     /**< An ir_entity. */
-       ident   *param_name; /**< For debugging purposes: the name of the parameter */
+       ir_type   *tp;      /**< A type. */
+       ir_entity *ent;     /**< An ir_entity. */
 } tp_ent_pair;
 
 /** Method type attributes. */
@@ -73,10 +72,8 @@ typedef struct {
        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_type     *value_ress;        /**< A type whose entities represent copied value results. */
        ir_variadicity variadicity;     /**< The variadicity of the method. */
-       size_t first_variadic_param;    /**< The index of the first variadic parameter or -1 if non-variadic .*/
-       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;
 
@@ -284,7 +281,6 @@ void set_class_dfn(ir_type *clss, int dfn);
 int  get_class_dfn(const ir_type *clss);
 
 void add_compound_member(ir_type *compound, ir_entity *entity);
-void remove_compound_member(ir_type *compound, ir_entity *entity);
 
 /** Initialize the type module. */
 void ir_init_type(void);
@@ -312,6 +308,35 @@ 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;
+}
+
+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)
+{
+       assert (tp->assoc_type == NULL || is_lowered_type(tp->assoc_type));
+       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;
+       /* 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;
+}
+
 static inline void *_get_type_link(const ir_type *tp)
 {
        assert(tp && tp->kind == k_type);