adapt to simplified opt_funccall interface
authorMatthias Braun <matze@braunis.de>
Wed, 30 Mar 2011 11:58:23 +0000 (13:58 +0200)
committerMatthias Braun <matze@braunis.de>
Wed, 30 Mar 2011 11:58:23 +0000 (13:58 +0200)
ast2firm.c
driver/firm_opt.c
driver/firm_opt.h
main.c

index ccc82c0..f124790 100644 (file)
@@ -82,8 +82,6 @@ static ir_node   *ijmp_list;
 static bool       constant_folding;
 static bool       initializer_use_bitfield_basetype;
 
-extern bool       have_const_functions;
-
 static const entity_t     *current_function_entity;
 static ir_node            *current_function_name;
 static ir_node            *current_funcsig;
@@ -901,7 +899,6 @@ static void handle_decl_modifiers(ir_entity *irentity, entity_t *entity)
                }
                if (modifiers & DM_CONST) {
                        add_entity_additional_properties(irentity, mtp_property_const);
-                       have_const_functions = true;
                }
        }
        if (modifiers & DM_USED) {
index bb7385d..4c89958 100644 (file)
@@ -150,12 +150,6 @@ static void rts_map(void)
 }
 
 static int *irg_dump_no;
-static int firm_const_exists;
-
-static void do_optimize_funccalls(void)
-{
-       optimize_funccalls(firm_const_exists, NULL);
-}
 
 static void do_lower_highlevel(ir_graph *irg)
 {
@@ -259,7 +253,7 @@ static opt_config_t opts[] = {
        IRP("inline",            do_inline,                "inlining",                                              OPT_FLAG_NONE),
        IRP("lower-const",       lower_const_code,         "lowering of constant code",                             OPT_FLAG_HIDE_OPTIONS | OPT_FLAG_NO_DUMP | OPT_FLAG_NO_VERIFY | OPT_FLAG_ESSENTIAL),
        IRP("target-lowering",   be_lower_for_target,      "lowering necessary for target architecture",            OPT_FLAG_HIDE_OPTIONS | OPT_FLAG_ESSENTIAL),
-       IRP("opt-func-call",     do_optimize_funccalls,    "function call optimization",                            OPT_FLAG_NONE),
+       IRP("opt-func-call",     optimize_funccalls,       "function call optimization",                            OPT_FLAG_NONE),
        IRP("opt-proc-clone",    do_cloning,               "procedure cloning",                                     OPT_FLAG_NONE),
        IRP("remove-unused",     garbage_collect_entities, "removal of unused functions/variables",                 OPT_FLAG_NO_DUMP | OPT_FLAG_NO_VERIFY),
        IRP("rts",               rts_map,                  "optimization of known library functions",               OPT_FLAG_HIDE_OPTIONS),
@@ -647,15 +641,11 @@ void gen_firm_init(void)
  * @param out                a file handle for the output, may be NULL
  * @param input_filename     the name of the (main) source file
  * @param c_mode             non-zero if "C" was compiled
- * @param new_firm_const_exists  non-zero, if the const attribute was used on functions
  */
-void gen_firm_finish(FILE *out, const char *input_filename,
-                     int new_firm_const_exists)
+void gen_firm_finish(FILE *out, const char *input_filename)
 {
        int i;
 
-       firm_const_exists = new_firm_const_exists;
-
        /* the general for dumping option must be set, or the others will not work*/
        firm_dump.ir_graph
                = (a_byte) (firm_dump.ir_graph | firm_dump.all_phases | firm_dump.extbb);
index 6a00b1f..d3e49d9 100644 (file)
@@ -101,7 +101,7 @@ void gen_firm_init(void);
 void disable_all_opts(void);
 
 /** called, after the Firm generation is completed. */
-void gen_firm_finish(FILE *out, const char *input_filename, int firm_const_exists);
+void gen_firm_finish(FILE *out, const char *input_filename);
 
 void gen_Firm_assembler(const char *input_filename);
 
diff --git a/main.c b/main.c
index 687c59f..7f3a087 100644 (file)
--- a/main.c
+++ b/main.c
@@ -106,7 +106,6 @@ bool               byte_order_big_endian     = false;
 bool               char_is_signed            = true;
 bool               strict_mode               = false;
 bool               use_builtins              = false;
-bool               have_const_functions      = false;
 atomic_type_kind_t wchar_atomic_kind         = ATOMIC_TYPE_INT;
 unsigned           force_long_double_size    = 0;
 bool               enable_main_collect2_hack = false;
@@ -1582,7 +1581,7 @@ graph_built:
                                return EXIT_SUCCESS;
                        }
 
-                       gen_firm_finish(asm_out, filename, have_const_functions);
+                       gen_firm_finish(asm_out, filename);
                        if (asm_out != out) {
                                fclose(asm_out);
                        }