remove irsimpletype stuff (unused/broken)
[libfirm] / ir / be / beabi.c
index 752c3fa..a12c7f7 100644 (file)
@@ -61,7 +61,7 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg;)
 typedef struct be_abi_call_arg_t {
        unsigned is_res   : 1;  /**< 1: the call argument is a return value. 0: it's a call parameter. */
        unsigned in_reg   : 1;  /**< 1: this argument is transmitted in registers. */
-       unsigned on_stack : 1;  /**< 1: this argument is transmitted on the stack. */
+       unsigned on_stack : 1;  /**< 1: this argument is transmitted on the stack. */
        unsigned callee   : 1;  /**< 1: someone called us. 0: We call another function */
 
        int                    pos;
@@ -112,9 +112,6 @@ static ir_heights_t *ir_heights;
 /** Flag: if set, try to omit the frame pointer in all routines. */
 static int be_omit_fp = 1;
 
-/** Flag: if set, try to omit the frame pointer in leaf routines only. */
-static int be_omit_leaf_fp = 1;
-
 /*
      _    ____ ___    ____      _ _ _                _
     / \  | __ )_ _|  / ___|__ _| | | |__   __ _  ___| | _____
@@ -142,7 +139,7 @@ static int cmp_call_arg(const void *a, const void *b, size_t n)
  * @param call      the abi call
  * @param is_res    true for call results, false for call arguments
  * @param pos       position of the argument
- * @param callee       context type - if we are callee or caller
+ * @param callee    context type - if we are callee or caller
  */
 static be_abi_call_arg_t *get_call_arg(be_abi_call_t *call, int is_res, int pos, int callee)
 {
@@ -263,7 +260,7 @@ static be_abi_call_t *be_abi_call_new(const arch_register_class_t *cls_addr)
        call->cb         = NULL;
        call->cls_addr   = cls_addr;
 
-       call->flags.bits.try_omit_fp = be_omit_fp | be_omit_leaf_fp;
+       call->flags.bits.try_omit_fp = be_omit_fp;
 
        return call;
 }
@@ -473,7 +470,7 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
                        /* Insert a store for primitive arguments. */
                        if (is_atomic_type(param_type)) {
                                ir_node *store;
-                               ir_node *mem_input = do_seq ? curr_mem : new_NoMem();
+                               ir_node *mem_input = do_seq ? curr_mem : new_r_NoMem(irg);
                                store = new_rd_Store(dbgi, bl, mem_input, addr, param, 0);
                                mem   = new_r_Proj(store, mode_M, pn_Store_M);
                        } else {
@@ -519,9 +516,9 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
 
        /* Put caller save into the destroyed set and state registers in the states
         * set */
-       for (i = 0, n = arch_env_get_n_reg_class(arch_env); i < n; ++i) {
+       for (i = 0, n = arch_env->n_register_classes; i < n; ++i) {
                unsigned j;
-               const arch_register_class_t *cls = arch_env_get_reg_class(arch_env, i);
+               const arch_register_class_t *cls = &arch_env->register_classes[i];
                for (j = 0; j < cls->n_regs; ++j) {
                        const arch_register_t *reg = arch_register_for_index(cls, j);
 
@@ -1833,8 +1830,8 @@ static void modify_irg(ir_graph *irg)
        }
 
        /* Collect all callee-save registers */
-       for (i = 0, n = arch_env_get_n_reg_class(arch_env); i < n; ++i) {
-               const arch_register_class_t *cls = arch_env_get_reg_class(arch_env, i);
+       for (i = 0, n = arch_env->n_register_classes; i < n; ++i) {
+               const arch_register_class_t *cls = &arch_env->register_classes[i];
                for (j = 0; j < cls->n_regs; ++j) {
                        const arch_register_t *reg = &cls->regs[j];
                        if (arch_register_type_is(reg, callee_save) ||
@@ -1939,7 +1936,7 @@ static void modify_irg(ir_graph *irg)
                                        ir_mode *mode      = get_type_mode(param_type);
                                        ir_mode *load_mode = arg->load_mode;
 
-                                       ir_node *load = new_r_Load(start_bl, new_NoMem(), addr, load_mode, cons_floats);
+                                       ir_node *load = new_r_Load(start_bl, new_r_NoMem(irg), addr, load_mode, cons_floats);
                                        repl = new_r_Proj(load, load_mode, pn_Load_res);
 
                                        if (mode != load_mode) {
@@ -1996,10 +1993,10 @@ static void fix_call_state_inputs(ir_graph *irg)
        arch_register_t **stateregs = NEW_ARR_F(arch_register_t*, 0);
 
        /* Collect caller save registers */
-       n = arch_env_get_n_reg_class(arch_env);
+       n = arch_env->n_register_classes;
        for (i = 0; i < n; ++i) {
                unsigned j;
-               const arch_register_class_t *cls = arch_env_get_reg_class(arch_env, i);
+               const arch_register_class_t *cls = &arch_env->register_classes[i];
                for (j = 0; j < cls->n_regs; ++j) {
                        const arch_register_t *reg = arch_register_for_index(cls, j);
                        if (arch_register_type_is(reg, state)) {
@@ -2143,7 +2140,7 @@ static void fix_pic_symconsts(ir_node *node, void *data)
                        dbgi             = get_irn_dbg_info(pred);
                        trampoline       = get_trampoline(be, entity);
                        trampoline_const = new_rd_SymConst_addr_ent(dbgi, irg, mode_P_code,
-                                                                   trampoline, NULL);
+                                                                   trampoline);
                        set_irn_n(node, i, trampoline_const);
                        continue;
                }
@@ -2166,14 +2163,14 @@ static void fix_pic_symconsts(ir_node *node, void *data)
                dbgi         = get_irn_dbg_info(pred);
                pic_symbol   = get_pic_symbol(be, entity);
                pic_symconst = new_rd_SymConst_addr_ent(dbgi, irg, mode_P_code,
-                                                       pic_symbol, NULL);
+                                                       pic_symbol);
                add = new_r_Add(block, pic_base, pic_symconst, mode);
                mark_irn_visited(add);
 
                /* we need an extra indirection for global data outside our current
                   module. The loads are always safe and can therefore float
                   and need no memory input */
-               load     = new_r_Load(block, new_NoMem(), add, mode, cons_floats);
+               load     = new_r_Load(block, new_r_NoMem(irg), add, mode, cons_floats);
                load_res = new_r_Proj(load, mode, pn_Load_res);
 
                set_irn_n(node, i, load_res);
@@ -2203,7 +2200,6 @@ be_abi_irg_t *be_abi_introduce(ir_graph *irg)
                return env;
 
        be_omit_fp      = options->omit_fp;
-       be_omit_leaf_fp = options->omit_leaf_fp;
 
        env->dce_survivor = new_survive_dce();
        env->keep_map     = pmap_create();