remove (broken+unused) support for right_to_left parameter passing
authorMatthias Braun <matze@braunis.de>
Thu, 4 Aug 2011 11:33:57 +0000 (13:33 +0200)
committerMatthias Braun <matze@braunis.de>
Thu, 4 Aug 2011 11:33:57 +0000 (13:33 +0200)
ir/be/TEMPLATE/bearch_TEMPLATE.c
ir/be/amd64/bearch_amd64.c
ir/be/beabi.c
ir/be/beabi.h
ir/be/ia32/bearch_ia32.c

index 1596442..c0e7f56 100644 (file)
@@ -248,7 +248,6 @@ static void TEMPLATE_get_call_abi(const void *self, ir_type *method_type,
        (void) self;
 
        /* set abi flags for calls */
-       call_flags.bits.left_to_right         = 0;
        call_flags.bits.store_args_sequential = 1;
        call_flags.bits.try_omit_fp           = 1;
        call_flags.bits.fp_free               = 0;
index 7775e2f..8b44edc 100644 (file)
@@ -420,7 +420,6 @@ static void amd64_get_call_abi(const void *self, ir_type *method_type,
        (void) self;
 
        /* set abi flags for calls */
-       call_flags.bits.left_to_right         = 0;
        call_flags.bits.store_args_sequential = 0;
        call_flags.bits.try_omit_fp           = 1;
        call_flags.bits.fp_free               = 0;
index ca2d907..1c85655 100644 (file)
@@ -416,12 +416,8 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
                ir_node **in       = ALLOCAN(ir_node*, n_stack_params+1);
                unsigned  n_in     = 0;
 
-               /*
-                * Reverse list of stack parameters if call arguments are from left to right.
-                * We must them reverse again if they are pushed (not stored) and the stack
-                * direction is downwards.
-                */
-               if (call->flags.bits.left_to_right ^ do_seq) {
+               /* push params in reverse direction because stack grows downwards */
+               if (do_seq) {
                        for (i = 0; i < n_stack_params >> 1; ++i) {
                                int other  = n_stack_params - i - 1;
                                int tmp    = stack_param_idx[i];
@@ -1133,7 +1129,6 @@ static void process_calls(ir_graph *irg)
  * Changes a possibly allocated value param type by moving
  * entities to the stack layout type.
  *
- * @param env           the ABI environment
  * @param call          the current call ABI
  * @param method_type   the method type
  * @param val_param_tp  the value parameter type, will be destroyed
@@ -1141,15 +1136,11 @@ static void process_calls(ir_graph *irg)
  *
  * @return the stack argument layout type
  */
-static ir_type *compute_arg_type(be_abi_irg_t *env, ir_graph *irg,
-                                 be_abi_call_t *call,
+static ir_type *compute_arg_type(ir_graph *irg, be_abi_call_t *call,
                                                                 ir_type *method_type, ir_type *val_param_tp,
                                                                 ir_entity ***param_map)
 {
-       int dir  = env->call->flags.bits.left_to_right ? 1 : -1;
-       int inc  = -dir;
        int n    = get_method_n_params(method_type);
-       int curr = inc > 0 ? 0 : n - 1;
        struct obstack *obst = be_get_be_obst(irg);
        int ofs  = 0;
 
@@ -1161,9 +1152,9 @@ static ir_type *compute_arg_type(be_abi_irg_t *env, ir_graph *irg,
 
        *param_map = map = OALLOCN(obst, ir_entity*, n);
        res = new_type_struct(id_mangle_u(id, new_id_from_chars("arg_type", 8)));
-       for (i = 0; i < n; ++i, curr += inc) {
-               ir_type *param_type    = get_method_param_type(method_type, curr);
-               be_abi_call_arg_t *arg = get_call_arg(call, 0, curr, 1);
+       for (i = 0; i < n; ++i) {
+               ir_type *param_type    = get_method_param_type(method_type, i);
+               be_abi_call_arg_t *arg = get_call_arg(call, 0, i, 1);
 
                map[i] = NULL;
                if (arg->on_stack) {
@@ -1700,7 +1691,7 @@ static void modify_irg(ir_graph *irg)
                }
        }
 
-       arg_type = compute_arg_type(env, irg, call, method_type, tp, &param_map);
+       arg_type = compute_arg_type(irg, call, method_type, tp, &param_map);
 
        /* Convert the Sel nodes in the irg to frame addr nodes: */
        ctx.value_param_list = NEW_ARR_F(ent_pos_pair, 0);
index f9a0246..3fb407f 100644 (file)
@@ -38,7 +38,6 @@
 #include "beabi.h"
 
 struct be_abi_call_flags_bits_t {
-       unsigned left_to_right          : 1;  /**< Arguments are from left to right. */
        unsigned store_args_sequential  : 1;  /**< Use sequential stores for arguments. */
        unsigned try_omit_fp            : 1;  /**< Try to omit the frame pointer. */
        unsigned fp_free                : 1;  /**< The function can use any register as frame pointer. */
index 7dc3931..a3a4257 100644 (file)
@@ -1667,7 +1667,6 @@ static void ia32_get_call_abi(const void *self, ir_type *method_type,
        (void) self;
 
        /* set abi flags for calls */
-       call_flags.bits.left_to_right         = 0;  /* always last arg first on stack */
        call_flags.bits.store_args_sequential = 0;
        /* call_flags.bits.try_omit_fp                 not changed: can handle both settings */
        call_flags.bits.fp_free               = 0;  /* the frame pointer is fixed in IA32 */