no need for no_float_fold hack anymore
[libfirm] / ir / be / beabi.c
index 03a5baa..a86183b 100644 (file)
@@ -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;
-
 /*
      _    ____ ___    ____      _ _ _                _
     / \  | __ )_ _|  / ___|__ _| | | |__   __ _  ___| | _____
@@ -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;
 }
@@ -2095,18 +2092,26 @@ static int can_address_relative(ir_entity *entity)
                && !(get_entity_linkage(entity) & IR_LINKAGE_MERGE);
 }
 
+static ir_node *get_pic_base(ir_graph *irg)
+{
+       const arch_env_t *arch_env = be_get_irg_arch_env(irg);
+       if (arch_env->impl->get_pic_base == NULL)
+               return NULL;
+       return arch_env->impl->get_pic_base(irg);
+}
+
 /** patches SymConsts to work in position independent code */
 static void fix_pic_symconsts(ir_node *node, void *data)
 {
-       ir_node      *pic_base;
-       ir_node      *add;
-       ir_node      *block;
-       ir_mode      *mode;
-       ir_node      *load;
-       ir_node      *load_res;
-       ir_graph     *irg = get_irn_irg(node);
-       int           arity, i;
-       be_main_env_t *be = be_get_irg_main_env(irg);
+       ir_graph         *irg = get_irn_irg(node);
+       be_main_env_t    *be  = be_get_irg_main_env(irg);
+       ir_node          *pic_base;
+       ir_node          *add;
+       ir_node          *block;
+       ir_mode          *mode;
+       ir_node          *load;
+       ir_node          *load_res;
+       int               arity, i;
        (void) data;
 
        arity = get_irn_arity(node);
@@ -2142,7 +2147,7 @@ static void fix_pic_symconsts(ir_node *node, void *data)
 
                /* everything else is accessed relative to EIP */
                mode     = get_irn_mode(pred);
-               pic_base = arch_code_generator_get_pic_base(be_get_irg_cg(irg));
+               pic_base = get_pic_base(irg);
 
                /* all ok now for locally constructed stuff */
                if (can_address_relative(entity)) {
@@ -2195,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();