Fixed a bug in scheduling and adapted coloring
[libfirm] / ir / be / besched.h
1
2 #ifndef _BESCHED_H
3 #define _BESCHED_H
4
5 #include <stdio.h>
6 #include "irgraph.h"
7 #include "irnode.h"
8
9 void be_sched_dump(FILE *f, const ir_graph *irg);
10
11 int (sched_get_time_step)(const ir_node *irn);
12 int (sched_has_next)(const ir_node *irn);
13 int (sched_has_prev)(const ir_node *irn);
14 ir_node *(sched_next)(const ir_node *irn);
15 ir_node *(sched_prev)(const ir_node *irn);
16 ir_node *(sched_first)(const ir_node *block);
17 ir_node *(sched_last)(const ir_node *block);
18 ir_node *(sched_add_before)(ir_node *before, ir_node *irn);
19 ir_node *(sched_add_after)(ir_node *before, ir_node *irn);
20
21 /**
22  * A shorthand macro for iterating over a schedule.
23  * @param block The block.
24  * @param irn A ir node pointer used as an iterator.
25  */
26 #define sched_foreach(block,irn) \
27         for(irn = sched_first(block); !is_Block(irn); irn = sched_next(irn))
28
29 /**
30  * A shorthand macro for reversely iterating over a schedule.
31  * @param block The block.
32  * @param irn A ir node pointer used as an iterator.
33  */
34 #define sched_foreach_reverse(block,irn) \
35         for(irn = sched_last(block); !is_Block(irn); irn = sched_prev(irn))
36
37 #endif