- Split bearch.h correctly into bearch.h and bearch_t.h
[libfirm] / ir / be / beuses.h
1 /**
2  * @file   beuse.h
3  * @date   27.06.2005
4  * @author Sebastian Hack, Matthias Braun
5  *
6  * Determine future usages of values.
7  *
8  * Copyright (C) 2005 Universitaet Karlsruhe
9  * Released under the GPL
10  */
11 #ifndef _BEUSES_H
12 #define _BEUSES_H
13
14 #include "bearch_t.h"
15 #include "belive.h"
16
17 typedef struct _be_next_use_t {
18         unsigned time;
19         int outermost_loop;
20 } be_next_use_t;
21
22 #define USES_INFINITY                 10000000
23 #define USES_PENDING                   9999999
24
25 static INLINE int USES_IS_INFINITE(unsigned time)
26 {
27         return time >= USES_INFINITY;
28 }
29
30 static INLINE int USES_IS_PENDING(unsigned time)
31 {
32         return time == USES_PENDING;
33 }
34
35 typedef struct _be_uses_t be_uses_t;
36
37 be_next_use_t be_get_next_use(be_uses_t *uses, ir_node *from,
38                          unsigned from_step, const ir_node *def,
39                          int skip_from_uses);
40
41 be_uses_t *be_begin_uses(ir_graph *irg, const be_lv_t *lv);
42
43 void be_end_uses(be_uses_t *uses);
44
45 #endif /* _BEUSES_H */