fixed ifdef
[libfirm] / ir / stat / firmstat.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/ir/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
12
13 # ifndef _FIRMSTAT_H_
14 # define _FIRMSTAT_H_
15
16 #ifdef FIRM_STATISTICS
17
18 typedef enum {
19   STAT_OPT_STG        = 0,              /**< straightening optimization */
20   STAT_OPT_IFSIM      = 1,              /**< if simplification */
21   STAT_OPT_ALGSIM     = 2,              /**< algebraic simplification */
22   STAT_OPT_PHI        = 3,              /**< Phi optmization */
23   STAT_OPT_WAW        = 4,              /**< Write-After-Write optimization */
24   STAT_OPT_WAR        = 5,              /**< Write-After-Read optimization */
25   STAT_OPT_TUPLE      = 6,              /**< Tuple optimization */
26   STAT_OPT_ID         = 7,              /**< ID optimization */
27   STAT_OPT_CONST_EVAL = 8,              /**< constant evaluation */
28   STAT_LOWERED        = 9,              /**< lowered */
29
30   STAT_OPT_MAX        = 10
31 }
32 stat_opt_kind;
33
34 /**
35  * initialize the statistics module.
36  */
37 void stat_init(void);
38
39 /**
40  * Finish the statistics.
41  */
42 void stat_finish(void);
43
44 /**
45  * A new IR op is registered.
46  */
47 void stat_new_ir_op(const ir_op *op);
48
49 /**
50  * An IR op is freed.
51  */
52 void stat_free_ir_op(const ir_op *op);
53
54 /**
55  * A new node is created.
56  */
57 void stat_new_node(const ir_node *node);
58
59 /**
60  * A node is changed into a Id node
61  */
62 void stat_turn_into_id(const ir_node *node);
63
64 /**
65  * A new graph was created
66  */
67 void stat_new_graph(ir_graph *irg, entity *ent);
68
69 /**
70  * A graph was deleted
71  */
72 void stat_free_graph(ir_graph *irg);
73
74 /**
75  * A walk over a graph is initiated
76  */
77 void stat_irg_walk(ir_graph *irg, void *pre, void *post);
78
79 /**
80  * A walk over the graph's blocks is initiated
81  */
82 void stat_irg_block_walk(ir_graph *irg, const ir_node *node, void *pre, void *post);
83
84 /**
85  * Some nodes were optimized into some others due to an optimization
86  */
87 void stat_merge_nodes(
88     ir_node **new_node_array, int new_num_entries,
89     ir_node **old_node_array, int old_num_entries,
90     stat_opt_kind opt);
91
92 /**
93  * A node was lowered into other nodes
94  */
95 void stat_lower(ir_node *node);
96
97 /**
98  * A graph was inlined
99  */
100 void stat_inline(ir_node *call, ir_graph *irg);
101
102 /**
103  * A graph with tail-recursions was optimized.
104  */
105 void stat_tail_rec(ir_graph *irg);
106
107 /**
108  * Start the dead node elimination.
109  */
110 void stat_dead_node_elim_start(ir_graph *irg);
111
112 /**
113  * Stops the dead node elimination.
114  */
115 void stat_dead_node_elim_stop(ir_graph *irg);
116
117 #else
118
119 #define stat_init()
120 #define stat_finish()
121 #define stat_new_ir_op(op)
122 #define stat_free_ir_op(op)
123 #define stat_new_node(node)
124 #define stat_turn_into_id(node)
125 #define stat_new_graph(irg, ent)
126 #define stat_free_graph(irg)
127 #define stat_irg_walk(irg, pre, post)
128 #define stat_irg_block_walk(irg, node, pre, post)
129 #define stat_merge_nodes(new_node_array, new_num_entries, old_node_array, old_num_entries, opt)
130 #define stat_lower(node)
131 #define stat_inline(call, irg)
132 #define stat_tail_rec(irg)
133 #define stat_dead_node_elim_start(irg)
134 #define stat_dead_node_elim_stop(irg)
135
136 #endif
137
138 #endif /* _FIRMSTAT_H_ */