Fixed 'inline' lossage --flo
[libfirm] / ir / stat / firmstat.c
1 /*
2  * Project:     libFIRM
3  * File name:   ir/ir/firmstat.c
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 #ifdef HAVE_CONFIG_H
13 # include <config.h>
14 #endif
15
16 # include <string.h>
17
18 # include "irop_t.h"
19 # include "irnode_t.h"
20
21 # include "xmalloc.h"
22
23 /*
24  * 64 bit should be enough for now
25  */
26 #define STAT_CNT_NUM 2
27
28 typedef struct _counter_t {
29   unsigned cnt[STAT_CNT_NUM];
30 } counter_t;
31
32
33 static INLINE cnt_inc(counter_t *cnt)
34 {
35   int i;
36
37   for (i = 0; i < STAT_CNT_NUM; ++i) {
38     if (++cnt->cnt[i])
39       break;
40 }
41
42 static INLINE cnt_dec(counter_t *cnt)
43 {
44   int i;
45
46   for (i = 0; i < STAT_CNT_NUM; ++i) {
47     if (--cnt->cnt[i] != -1)
48       break;
49 }
50
51 /* A new IR op is registered. */
52 void stat_new_ir_op(const ir_op *op)
53 {
54 }
55
56 /* An IR op is freed. */
57 void stat_free_ir_op(const ir_op *op)
58 {
59 }
60
61 /* initialize the statistics module. */
62 void stat_init(void)
63 {
64 }
65
66 /* A new node is created. */
67 void stat_new_node(const ir_node *node)
68 {
69 }