X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=driver%2Ffirm_opt.c;h=9ccb3e3bbfb1fdc9f5da11fce579ebe2b1e12547;hb=8845feb009950d2c76a394660a5bd81a0be0f2a6;hp=5145f13ab87284b927ccb739f09cb1f12796fdb6;hpb=ba9e6d83125682bf868fe41d96cf7c86bcaaa5a3;p=cparser diff --git a/driver/firm_opt.c b/driver/firm_opt.c index 5145f13..9ccb3e3 100644 --- a/driver/firm_opt.c +++ b/driver/firm_opt.c @@ -1,5 +1,9 @@ +/* + * This file is part of cparser. + * Copyright (C) 2012 Michael Beck + */ + /** - * (C) 2005-2010 * @file * @author Michael Beck, Matthias Braun * @brief Firm-generating back end optimizations. @@ -54,8 +58,6 @@ struct a_firm_dump { bool ir_graph; /**< dump all graphs */ bool all_phases; /**< dump the IR graph after all phases */ bool statistic; /**< Firm statistic setting */ - bool stat_pattern; /**< enable Firm statistic pattern */ - bool stat_dag; /**< enable Firm DAG statistic */ }; struct a_firm_be_opt { @@ -88,8 +90,6 @@ static struct a_firm_dump firm_dump = { .ir_graph = false, .all_phases = false, .statistic = STAT_NONE, - .stat_pattern = 0, - .stat_dag = 0, }; #define X(a) a, sizeof(a)-1 @@ -143,8 +143,6 @@ static const struct params { { X("stat-after-lower"), &firm_dump.statistic, STAT_AFTER_LOWER, "Firm statistic output after lowering" }, { X("stat-final-ir"), &firm_dump.statistic, STAT_FINAL_IR, "Firm statistic after final optimization" }, { X("stat-final"), &firm_dump.statistic, STAT_FINAL, "Firm statistic after code generation" }, - { X("stat-pattern"), &firm_dump.stat_pattern, 1, "Firm statistic calculates most used pattern" }, - { X("stat-dag"), &firm_dump.stat_dag, 1, "Firm calculates DAG statistics" }, }; #undef X @@ -737,21 +735,6 @@ void gen_firm_init(void) timer_register(t_backend, "Firm: backend"); } -static void init_statistics(void) -{ - unsigned pattern = 0; - - if (firm_dump.stat_pattern) - pattern |= FIRMSTAT_PATTERN_ENABLED; - - if (firm_dump.stat_dag) - pattern |= FIRMSTAT_COUNT_DAG; - - firm_init_stat(firm_dump.statistic == STAT_NONE ? - 0 : FIRMSTAT_ENABLED | FIRMSTAT_COUNT_STRONG_OP - | FIRMSTAT_COUNT_CONSTS | pattern); -} - /** * Called, after the Firm generation is completed, * do all optimizations and backend call here. @@ -766,7 +749,7 @@ void generate_code(FILE *out, const char *input_filename) /* 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(); + firm_init_stat(); do_node_verification((firm_verification_t) firm_opt.verify);