init_stat must be empty if statistics is not enabled
[libfirm] / ir / stat / firmstat.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/stat/firmstat.h
4  * Purpose:     Statistics for Firm.
5  * Author:      Michael Beck
6  * Created:
7  * CVS-ID:      $Id$
8  * Copyright:   (c) 2004 Universität Karlsruhe
9  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
10  */
11 #ifndef _FIRMSTAT_H_
12 #define _FIRMSTAT_H_
13
14 /**
15  * @file firmstat.h
16  */
17 #include "irop.h"
18 #include "irnode.h"
19 #include "irgraph.h"
20
21 /**
22  * Statistic options, can be or'ed.
23  */
24 enum firmstat_options_t {
25   FIRMSTAT_ENABLED         = 0x00000001,    /**< enable statistics */
26   FIRMSTAT_PATTERN_ENABLED = 0x00000002,    /**< enable pattern calculation */
27   FIRMSTAT_COUNT_STRONG_OP = 0x00000004,    /**< if set, count Mul/Div/Mod/DivMod by constant */
28   FIRMSTAT_COUNT_DAG       = 0x00000008,    /**< if set, count DAG statistics */
29   FIRMSTAT_COUNT_DELETED   = 0x00000010,    /**< if set, count deleted graphs */
30   FIRMSTAT_CSV_OUTPUT      = 0x10000000     /**< CSV output of some mini-statistic */
31 };
32
33 /**
34  * Finish the statistics.
35  * Never called from libFirm should be called from user.
36  *
37  * @param name   basename of the statistic output file
38  */
39 void stat_finish(const char *name);
40
41 #ifdef FIRM_STATISTICS
42
43 /**
44  * initialize the statistics module.
45  *
46  * @param enable_options  a bitmask containing the statistic options
47  */
48 void init_stat(unsigned enable_options);
49
50 #else
51
52 #define init_stat(enable_options)
53
54 #endif /* FIRM_STATISTICS */
55
56 #endif /* _FIRMSTAT_H_ */