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"
32 firm_kind kind; /**< k_ir_extblk */
33 unsigned long visited; /**< visited flag */
34 ir_node **blks; /**< blocks belonging to this extended block */
35 void *link; /**< private link field */
40 * Gets the visited counter of an extended block.
41 * Internal version for libFirm.
43 static INLINE unsigned long
44 _get_extbb_visited(const ir_extblk *blk) {
50 * Sets the visited counter of an extended block.
51 * Internal version for libFirm.
54 _set_extbb_visited(ir_extblk *blk, unsigned long visited) {
56 blk->visited = visited;
60 * Mark an extended block as visited in a graph.
61 * Internal version for libFirm.
64 _mark_extbb_visited(ir_extblk *blk) {
66 blk->visited = current_ir_graph->visited;
70 * Returns non-zero if an extended was visited.
71 * Internal version for libFirm.
74 _extbb_visited(const ir_extblk *blk) {
76 return blk->visited >= current_ir_graph->visited;
80 * Returns non-zero if an extended block was NOT visited.
81 * Internal version for libFirm.
84 _extbb_not_visited(const ir_extblk *blk) {
86 return blk->visited < current_ir_graph->visited;
90 * Returns the link field of an extended block.
91 * Internal version for libFirm.
94 _get_extbb_link(const ir_extblk *blk) {
100 * Sets the link field of an extended block.
101 * Internal version for libFirm.
104 _set_extbb_link(ir_extblk *blk, void *link) {
110 * Return the number of basis blocks of an extended block
113 _get_extbb_n_blocks(const ir_extblk *blk) {
115 return ARR_LEN(blk->blks);
119 * Return the i'th basis block of an extended block
121 static INLINE ir_node *
122 _get_extbb_block(ir_extblk *blk, int pos)
124 assert(blk && 0 <= pos && pos < _get_extbb_n_blocks(blk));
125 return blk->blks[pos];
129 * Return the leader basis block of an extended block
131 static INLINE ir_node *
132 _get_extbb_leader(ir_extblk *blk)
137 #define get_extbb_visited(blk) _get_extbb_visited(blk)
138 #define set_extbb_visited(blk, v) _set_extbb_visited(blk, v)
139 #define mark_extbb_visited(blk) _mark_extbb_visited(blk)
140 #define extbb_visited(blk) _extbb_visited(blk)
141 #define extbb_not_visited(blk) _extbb_not_visited(blk)
142 #define get_extbb_link(blk) _get_extbb_link(blk)
143 #define set_extbb_link(blk, link) _set_extbb_link(blk, link)
144 #define get_extbb_n_blocks(blk) _get_extbb_n_blocks(blk)
145 #define get_extbb_leader(blk) _get_extbb_leader(blk)
147 #endif /* _IREXTBB_H_ */