535bfb2e7453336d2205207a29b6b7ec91d35521
[libfirm] / ir / be / besched.h
1
2 #ifndef _BESCHED_H
3 #define _BESCHED_H
4
5 #include <stdio.h>
6
7 void be_sched_dump(FILE *f, const ir_graph *irg);
8
9 int (sched_get_time_step)(const ir_node *irn);
10 int (sched_has_succ)(const ir_node *irn);
11 int (sched_has_prev)(const ir_node *irn);
12 ir_node *(sched_succ)(const ir_node *irn);
13 ir_node *(sched_prev)(const ir_node *irn);
14 ir_node *(sched_first)(const ir_node *block);
15 ir_node *(sched_last)(const ir_node *block);
16 ir_node *(sched_add)(ir_node *block, const ir_node *irn);
17
18 /**
19  * A shorthand macro for iterating over a schedule.
20  * @param block The block.
21  * @param irn A ir node pointer used as an iterator.
22  */
23 #define sched_foreach(block,irn) \
24         for(irn = sched_first(block); irn; irn = sched_succ(irn))
25
26 /**
27  * A shorthand macro for reversely iterating over a schedule.
28  * @param block The block.
29  * @param irn A ir node pointer used as an iterator.
30  */
31 #define sched_foreach_reverse(block,irn) \
32         for(irn = sched_last(block); irn; irn = sched_prev(irn))
33
34 #endif