3 * File name: ir/ana/irextbb_t.h
4 * Purpose: Extended basis block support.
9 * Copyright: (c) 2002-2005 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
16 * Computes extended basic blocks.
18 * @author Michael Beck
23 #include "firm_config.h"
24 #include "irgraph_t.h"
31 firm_kind kind; /**< k_ir_extblk */
32 unsigned long visited; /**< visited flag */
33 ir_node **blks; /**< blocks belonging to this extended block */
34 void *link; /**< private link field */
39 * Gets the visited counter of an extended block.
40 * Internal version for libFirm.
42 static INLINE unsigned long
43 _get_extbb_visited(const ir_extblk *blk) {
49 * Sets the visited counter of an extended block.
50 * Internal version for libFirm.
53 _set_extbb_visited(ir_extblk *blk, unsigned long visited) {
55 blk->visited = visited;
59 * Mark an extended block as visited in a graph.
60 * Internal version for libFirm.
63 _mark_extbb_visited(ir_extblk *blk) {
65 blk->visited = current_ir_graph->visited;
69 * Returns non-zero if an extended was visited.
70 * Internal version for libFirm.
73 _extbb_visited(const ir_extblk *blk) {
75 return blk->visited >= current_ir_graph->visited;
79 * Returns non-zero if an extended block was NOT visited.
80 * Internal version for libFirm.
83 _extbb_not_visited(const ir_extblk *blk) {
85 return blk->visited < current_ir_graph->visited;
89 * Returns the link field of an extended block.
90 * Internal version for libFirm.
93 _get_extbb_link(const ir_extblk *blk) {
99 * Sets the link field of an extended block.
100 * Internal version for libFirm.
103 _set_extbb_link(ir_extblk *blk, void *link) {
109 * Return the number of basis blocks of an extended block
112 _get_extbb_n_blocks(const ir_extblk *blk) {
114 return ARR_LEN(blk->blks);
118 * Return the i'th basis block of an extended block
120 static INLINE ir_node *
121 _get_extbb_block(ir_extblk *blk, int pos)
123 assert(blk && 0 <= pos && pos < _get_extbb_n_blocks(blk));
124 return blk->blks[pos];
127 #define get_extbb_visited(blk) _get_extbb_visited(blk)
128 #define set_extbb_visited(blk, v) _set_extbb_visited(blk, v)
129 #define mark_extbb_visited(blk) _mark_extbb_visited(blk)
130 #define extbb_visited(blk) _extbb_visited(blk)
131 #define extbb_not_visited(blk) _extbb_not_visited(blk)
132 #define get_extbb_link(blk) _get_extbb_link(blk)
133 #define set_extbb_link(blk, link) _set_extbb_link(blk, link)
134 #define get_extbb_n_blocks(blk) _get_extbb_n_blocks(blk)
136 #endif /* _IREXTBB_H_ */