remove the deprecated and unused construct of a value_res_base entities in method...
authorMatthias Braun <matze@braunis.de>
Thu, 17 Mar 2011 17:59:05 +0000 (18:59 +0100)
committerMatthias Braun <matze@braunis.de>
Wed, 30 Mar 2011 13:12:15 +0000 (15:12 +0200)
14 files changed:
include/libfirm/typerep.h
ir/be/arm/arm_transform.c
ir/be/ia32/ia32_intrinsics.c
ir/be/sparc/sparc_transform.c
ir/ir/irdump.c
ir/ir/irverify.c
ir/lower/lower_calls.c
ir/lower/lower_intrinsics.c
ir/opt/escape_ana.c
ir/opt/opt_inline.c
ir/opt/tailrec.c
ir/tr/type.c
ir/tr/type_t.h
scripts/ir_spec.py

index 31adece..62acb93 100644 (file)
@@ -1548,10 +1548,6 @@ FIRM_API int is_Struct_type(const ir_type *strct);
  * - res_type:   A list with the types of parameters.  This list is ordered.
  *               The nth type in this list corresponds to the nth input to
  *               Return nodes.  (See ircons.h for more information.)
- *
- * - value_res_ents
- *               A list of entities (whose owner is a struct private to the
- *               method type) that represent results passed by value.
  */
 
 /* These macros define the suffixes for the types and entities used
@@ -1612,14 +1608,6 @@ FIRM_API ir_type *get_method_res_type(ir_type *method, size_t pos);
     Also changes the type in the pass-by-value representation by just
     changing the type of the corresponding entity if the representation is constructed. */
 FIRM_API void set_method_res_type(ir_type *method, size_t pos, ir_type *tp);
-/** Returns an entity that represents the copied value result.  Only necessary
-   for compounds passed by value. This information is constructed only on demand. */
-FIRM_API ir_entity *get_method_value_res_ent(ir_type *method, size_t pos);
-
-/**
- * Returns a type that represents the copied value results.
- */
-FIRM_API ir_type *get_method_value_res_type(const ir_type *method);
 
 /**
  * This enum flags the variadicity of methods (methods with a
index 1ee33a6..5e87ab6 100644 (file)
@@ -1564,7 +1564,6 @@ static ir_node *gen_Proj_Call(ir_node *node)
        case pn_Call_X_regular:
        case pn_Call_X_except:
        case pn_Call_T_result:
-       case pn_Call_P_value_res_base:
        case pn_Call_max:
                break;
        }
index 2a522d7..c8e9cbf 100644 (file)
@@ -130,7 +130,6 @@ static void resolve_call(ir_node *call, ir_node *l_res, ir_node *h_res, ir_graph
                                break;
 
                        case pn_Call_X_except:
-                       case pn_Call_P_value_res_base:
                                /* should not happen here */
                                edges_reroute(proj, bad, irg);
                                break;
@@ -174,7 +173,6 @@ static void resolve_call(ir_node *call, ir_node *l_res, ir_node *h_res, ir_graph
                set_Tuple_pred(call, pn_Call_X_regular,        jmp);
                set_Tuple_pred(call, pn_Call_X_except,         bad);
                set_Tuple_pred(call, pn_Call_T_result,         res);
-               set_Tuple_pred(call, pn_Call_P_value_res_base, bad);
        }
 }
 
index b029053..62fd6b7 100644 (file)
@@ -1969,7 +1969,6 @@ static ir_node *gen_Proj_Call(ir_node *node)
        case pn_Call_X_regular:
        case pn_Call_X_except:
        case pn_Call_T_result:
-       case pn_Call_P_value_res_base:
        case pn_Call_max:
                break;
        }
index 094c31a..fcd805e 100644 (file)
@@ -828,7 +828,6 @@ static const pns_lookup_t call_lut[] = {
        X(X_regular),
        X(X_except),
        X(T_result),
-       X(P_value_res_base)
 #undef X
 };
 
index 5814d2d..9bfcdc4 100644 (file)
@@ -414,8 +414,7 @@ static int verify_node_Proj_Call(ir_node *n, ir_node *p)
                        (proj == pn_Call_M                && mode == mode_M) ||
                        (proj == pn_Call_X_regular        && mode == mode_X) ||
                        (proj == pn_Call_X_except         && mode == mode_X) ||
-                       (proj == pn_Call_T_result         && mode == mode_T) ||
-                       (proj == pn_Call_P_value_res_base && mode_is_reference(mode))
+                       (proj == pn_Call_T_result         && mode == mode_T)
                ),
                "wrong Proj from Call", 0,
                show_proj_failure(p);
index 7ccc7b3..d3b6a5d 100644 (file)
@@ -364,32 +364,17 @@ static void fix_args_and_collect_calls(ir_node *n, void *ctx)
                if (env->params->flags & LF_COMPOUND_RETURN) {
                        /* check for compound returns */
                        ir_node *src = get_CopyB_src(n);
-                       /* older scheme using value_res_ent */
-                       if (is_Sel(src)) {
-                               ir_node *proj = get_Sel_ptr(src);
-                               if (is_Proj(proj) && get_Proj_proj(proj) == pn_Call_P_value_res_base) {
+                       if (is_Proj(src)) {
+                               ir_node *proj = get_Proj_pred(src);
+                               if (is_Proj(proj) && get_Proj_proj(proj) == pn_Call_T_result) {
                                        ir_node *call = get_Proj_pred(proj);
                                        if (is_Call(call)) {
-                                               /* found a CopyB from compound Call result */
-                                               cl_entry *e = get_Call_entry(call, env);
-                                               set_irn_link(n, e->copyb);
-                                               e->copyb = n;
-                                       }
-                               }
-                       } else {
-                               /* new scheme: compound results are determined by the call type only */
-                               if (is_Proj(src)) {
-                                       ir_node *proj = get_Proj_pred(src);
-                                       if (is_Proj(proj) && get_Proj_proj(proj) == pn_Call_T_result) {
-                                               ir_node *call = get_Proj_pred(proj);
-                                               if (is_Call(call)) {
-                                                       ctp = get_Call_type(call);
-                                                       if (is_compound_type(get_method_res_type(ctp, get_Proj_proj(src)))) {
-                                                               /* found a CopyB from compound Call result */
-                                                               cl_entry *e = get_Call_entry(call, env);
-                                                               set_irn_link(n, e->copyb);
-                                                               e->copyb = n;
-                                                       }
+                                               ctp = get_Call_type(call);
+                                               if (is_compound_type(get_method_res_type(ctp, get_Proj_proj(src)))) {
+                                                       /* found a CopyB from compound Call result */
+                                                       cl_entry *e = get_Call_entry(call, env);
+                                                       set_irn_link(n, e->copyb);
+                                                       e->copyb = n;
                                                }
                                        }
                                }
@@ -503,31 +488,14 @@ static ir_node *get_dummy_sel(ir_graph *irg, ir_node *block, ir_type *tp, wlk_en
  */
 static void add_hidden_param(ir_graph *irg, size_t n_com, ir_node **ins, cl_entry *entry, wlk_env *env)
 {
-       ir_node *p, *n, *src, *mem, *blk;
-       ir_entity *ent;
-       ir_type *owner;
+       ir_node *p, *n, *mem, *blk;
        size_t n_args;
 
        n_args = 0;
        for (p = entry->copyb; p; p = n) {
-               size_t idx;
-               n   = (ir_node*)get_irn_link(p);
-               src = get_CopyB_src(p);
-
-               /* old scheme using value_res_ent */
-               if (is_Sel(src)) {
-                       ent = get_Sel_entity(src);
-                       owner = get_entity_owner(ent);
-
-                       /* find the hidden parameter index */
-                       for (idx = 0; idx < get_struct_n_members(owner); ++idx)
-                               if (get_struct_member(owner, idx) == ent)
-                                       break;
-                       assert(idx < get_struct_n_members(owner));
-               } else {
-                       /* new scheme: compound returns are determined by the call type and are Proj's */
-                       idx = get_Proj_proj(src);
-               }
+               ir_node *src = get_CopyB_src(p);
+               size_t   idx = get_Proj_proj(src);
+               n = (ir_node*)get_irn_link(p);
 
                ins[idx] = get_CopyB_dst(p);
                mem      = get_CopyB_mem(p);
index 9495023..6482071 100644 (file)
@@ -236,7 +236,6 @@ static void replace_call(ir_node *irn, ir_node *call, ir_node *mem, ir_node *reg
        set_Tuple_pred(call, pn_Call_X_regular, reg_jmp);
        set_Tuple_pred(call, pn_Call_X_except, exc_jmp);
        set_Tuple_pred(call, pn_Call_T_result, irn);
-       set_Tuple_pred(call, pn_Call_P_value_res_base, new_r_Bad(irg));
 }  /* replace_call */
 
 /* A mapper for the integer abs. */
index 9d44435..2613202 100644 (file)
@@ -489,7 +489,6 @@ static void transform_alloc_calls(ir_graph *irg, walk_env_t *env)
        set_Tuple_pred(call, pn_Call_X_regular,        new_r_Jmp(blk));
     set_Tuple_pred(call, pn_Call_X_except,         new_r_Bad(irg));
     set_Tuple_pred(call, pn_Call_T_result,         new_r_Bad(irg));
-    set_Tuple_pred(call, pn_Call_P_value_res_base, new_r_Bad(irg));
 
     ++env->nr_deads;
   }
index c463306..84874fa 100644 (file)
@@ -558,9 +558,6 @@ int inline_method(ir_node *call, ir_graph *called_graph)
        /* handle the regular call */
        set_Tuple_pred(call, pn_Call_X_regular, new_r_Jmp(post_bl));
 
-       /* For now, we cannot inline calls with value_base */
-       set_Tuple_pred(call, pn_Call_P_value_res_base, new_r_Bad(irg));
-
        /* Finally the exception control flow.
           We have two possible situations:
           First if the Call branches to an exception handler:
index 6c6012a..39e54aa 100644 (file)
@@ -347,7 +347,6 @@ static void do_opt_tail_rec(ir_graph *irg, tr_env *env)
                        set_Tuple_pred(call, pn_Call_X_regular,        jmp);
                        set_Tuple_pred(call, pn_Call_X_except,         bad);
                        set_Tuple_pred(call, pn_Call_T_result,         tuple);
-                       set_Tuple_pred(call, pn_Call_P_value_res_base, bad);
 
                        for (i = 0; i < env->n_ress; ++i) {
                                ir_node *res = get_Return_res(p, i);
index 6ce4447..85d96e0 100644 (file)
@@ -81,13 +81,8 @@ ir_type *get_unknown_type(void)
        return firm_unknown_type;
 }
 
-/* Suffixes added to types used for pass-by-value representations. */
-static ident *value_ress_suffix = NULL;
-
 void ir_init_type(void)
 {
-       value_ress_suffix   = new_id_from_str(VALUE_RESS_SUFFIX);
-
        /* construct none and unknown type. */
        firm_none_type = new_type(tpop_none, mode_BAD, NULL);
        set_type_size_bytes(firm_none_type, 0);
@@ -118,7 +113,6 @@ void ir_finish_type(void)
                free_type(firm_unknown_type);
                firm_unknown_type = NULL;
        }
-       value_ress_suffix = NULL;
 }
 
 /** the global type visited flag */
@@ -1189,7 +1183,6 @@ ir_type *new_d_type_method(size_t n_param, size_t n_res, type_dbg_info *db)
        res->attr.ma.value_params         = NULL;
        res->attr.ma.n_res                = n_res;
        res->attr.ma.res_type             = XMALLOCNZ(tp_ent_pair, n_res);
-       res->attr.ma.value_ress           = NULL;
        res->attr.ma.variadicity          = variadicity_non_variadic;
        res->attr.ma.additional_properties = mtp_no_property;
        hook_new_type(res);
@@ -1228,7 +1221,6 @@ ir_type *clone_type_method(ir_type *tp)
        res->attr.ma.n_res                 = n_res;
        res->attr.ma.res_type              = XMALLOCN(tp_ent_pair, n_res);
        memcpy(res->attr.ma.res_type, tp->attr.ma.res_type, n_res * sizeof(res->attr.ma.res_type[0]));
-       res->attr.ma.value_ress            = tp->attr.ma.value_ress;
        res->attr.ma.variadicity           = tp->attr.ma.variadicity;
        res->attr.ma.additional_properties = tp->attr.ma.additional_properties;
        res->attr.ma.irg_calling_conv      = tp->attr.ma.irg_calling_conv;
@@ -1253,10 +1245,6 @@ void free_method_attrs(ir_type *method)
                free_type(method->attr.ma.value_params);
        }
        */
-       if (method->attr.ma.value_ress) {
-               free_type_entities(method->attr.ma.value_ress);
-               free_type(method->attr.ma.value_ress);
-       }
 }
 
 size_t (get_method_n_params)(const ir_type *method)
@@ -1351,36 +1339,6 @@ void set_method_res_type(ir_type *method, size_t pos, ir_type *tp)
        /* set the result ir_type */
        method->attr.ma.res_type[pos].tp = tp;
        /* If information constructed set pass-by-value representation. */
-       if (method->attr.ma.value_ress) {
-               assert(get_method_n_ress(method) == get_struct_n_members(method->attr.ma.value_ress));
-               set_entity_type(get_struct_member(method->attr.ma.value_ress, pos), tp);
-       }
-}
-
-ir_entity *get_method_value_res_ent(ir_type *method, size_t pos)
-{
-       assert(method->type_op == type_method);
-       assert(pos < get_method_n_ress(method));
-
-       if (!method->attr.ma.value_ress) {
-               /* result value type not created yet, build */
-               method->attr.ma.value_ress = build_value_type("<value result>",
-                       get_method_n_ress(method), method->attr.ma.res_type);
-       }
-       /*
-        * build_value_type() sets the method->attr.ma.value_ress type as default if
-        * no type is set!
-        */
-       assert((get_entity_type(method->attr.ma.res_type[pos].ent) != method->attr.ma.value_ress)
-              && "result type not yet set");
-
-       return method->attr.ma.res_type[pos].ent;
-}
-
-ir_type *get_method_value_res_type(const ir_type *method)
-{
-       assert(method->type_op == type_method);
-       return method->attr.ma.value_ress;
 }
 
 const char *get_variadicity_name(ir_variadicity vari)
index 7e3b2a7..13818ed 100644 (file)
@@ -72,7 +72,6 @@ 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. */
 mtp_additional_properties additional_properties; /**< Set of additional method properties. */
        unsigned irg_calling_conv;      /**< A set of calling convention flags. */
index 0f6ef7e..8d0a8fc 100755 (executable)
@@ -259,7 +259,6 @@ class Call(Op):
                ("X_regular",        "control flow when no exception occurs", "pn_Generic_X_regular"),
                ("X_except",         "control flow when exception occured",   "pn_Generic_X_except"),
                ("T_result",         "tuple containing all results",          "pn_Generic_other"),
-               ("P_value_res_base", "pointer to memory register containing copied results passed by value"),
        ]
        flags    = [ "fragile", "uses_memory" ]
        attrs    = [