From fa329099e9a55aa01e9b632ef136301f2c117634 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Tue, 20 Jul 2004 09:16:20 +0000 Subject: [PATCH] added option bitmask to init function [r3513] --- ir/stat/firmstat.c | 6 +++--- ir/stat/firmstat.h | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ir/stat/firmstat.c b/ir/stat/firmstat.c index 5a6c59e70..578570805 100644 --- a/ir/stat/firmstat.c +++ b/ir/stat/firmstat.c @@ -778,14 +778,14 @@ ir_op *stat_get_op_from_opcode(opcode code) } /* initialize the statistics module. */ -void stat_init(void) +void stat_init(unsigned enable_options) { #define X(a) a, sizeof(a)-1 int pseudo_id = 0; /* enable statistics */ - status->enable = 1; + status->enable = enable_options & FIRMSTAT_ENABLED; if (! status->enable) return; @@ -810,7 +810,7 @@ void stat_init(void) stat_register_dumper(&csv_dumper, "firmstat.csv"); /* initialize the pattern hash */ - stat_init_pattern_history(status->enable); + stat_init_pattern_history(enable_options & FIRMSTAT_PATTERN_ENABLED); #undef X } diff --git a/ir/stat/firmstat.h b/ir/stat/firmstat.h index e9017199c..106e32241 100644 --- a/ir/stat/firmstat.h +++ b/ir/stat/firmstat.h @@ -18,6 +18,14 @@ #include "irnode.h" #include "irgraph.h" +/** + * Statistic options, can be or'ed. + */ +enum firmstat_options_t { + FIRMSTAT_ENABLED = 0x00000001, /**< enable statistics */ + FIRMSTAT_PATTERN_ENABLED = 0x00000002 /**< enable pattern calculation */ +}; + /** * Finish the statistics. * Never called from libFirm should be called from user. @@ -44,8 +52,10 @@ typedef enum { /** * initialize the statistics module. + * + * @param enable_options Bitmask containing the statistic options */ -void stat_init(void); +void stat_init(unsigned enable_options); /** * A new IR op is registered. @@ -136,7 +146,7 @@ ir_op *stat_get_op_from_opcode(opcode code); #else -#define stat_init() +#define stat_init(flag) #define stat_new_ir_op(op) #define stat_free_ir_op(op) #define stat_new_node(node) -- 2.20.1