X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=driver%2Ffirm_opt.c;h=defb7aa8d18ffddcd867200670d980c19ec1d328;hb=9a9a71f0190e6a79bc3712a1adb8c935fe7e48ca;hp=2ea1dec4be2b8612a0a045e8fef584ca760b80bd;hpb=80bccee8d428d09cb812f42be44bb1864a5e476f;p=cparser diff --git a/driver/firm_opt.c b/driver/firm_opt.c index 2ea1dec..defb7aa 100644 --- a/driver/firm_opt.c +++ b/driver/firm_opt.c @@ -170,7 +170,7 @@ static void dump_all(const char *suffix) } /* entities of runtime functions */ -ir_entity_ptr rts_entities[rts_max]; +ir_entity *rts_entities[rts_max]; /** * Map runtime functions. @@ -178,7 +178,7 @@ ir_entity_ptr rts_entities[rts_max]; static void rts_map(void) { static const struct { - ir_entity_ptr *ent; /**< address of the rts entity */ + ir_entity **ent; /**< address of the rts entity */ i_mapper_func func; /**< mapper function. */ } mapper[] = { /* integer */ @@ -756,12 +756,9 @@ void generate_code(FILE *out, const char *input_filename) { int i; - set_optimize(1); - set_opt_constant_folding(firm_opt.const_folding); - set_opt_algebraic_simplification(firm_opt.const_folding); - set_opt_cse(firm_opt.cse); - set_opt_global_cse(0); - + /* initialize implicit opts, just to be sure because really the frontend + * should have called it already before starting graph construction */ + init_implicit_optimizations(); init_statistics(); do_node_verification((firm_verification_t) firm_opt.verify); @@ -833,6 +830,7 @@ static void disable_all_opts(void) firm_opt.alias_analysis = false; firm_opt.strict_alias = false; firm_opt.no_alias = false; + firm_opt.const_folding = false; FOR_EACH_OPT(config) { if (config->flags & OPT_FLAG_ESSENTIAL) { @@ -859,8 +857,6 @@ static bool firm_opt_option(const char *opt) void firm_option_help(print_option_help_func print_option_help) { - print_option_help(firm_options[0].option, firm_options[0].description); - FOR_EACH_OPT(config) { char buf[1024]; char buf2[1024]; @@ -967,3 +963,12 @@ void choose_optimization_pack(int level) break; } } + +void init_implicit_optimizations(void) +{ + set_optimize(1); + set_opt_constant_folding(firm_opt.const_folding); + set_opt_algebraic_simplification(firm_opt.const_folding); + set_opt_cse(firm_opt.cse); + set_opt_global_cse(0); +}