3 * File name: ir/ana/irextbb.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
25 #ifndef _IR_EXTBB_TYPEDEF_
26 #define _IR_EXTBB_TYPEDEF_
27 typedef struct _ir_extblk ir_extblk;
30 /** Flags for extended basic block state. */
32 ir_extblk_info_none = 0, /**< No extended basic block information is constructed. Default. */
33 ir_extblk_info_valid = 1, /**< Extended basic block information is valid. */
34 ir_extblk_info_invalid = 2 /**< Extended basic block information is constructed but invalid. */
35 } irg_extblk_info_state;
38 * Compute the extended basic blocks for a graph
40 void compute_extbb(ir_graph *irg);
43 * free all extended block info
45 void free_extbb(ir_graph *irg);
48 * Return the extended block of a node.
50 ir_extblk *get_nodes_extbb(ir_node *node);
53 * Gets the visited counter of an extended block.
55 unsigned long get_extbb_visited(const ir_extblk *blk);
58 * Sets the visited counter of an extended block.
60 void set_extbb_visited(ir_extblk *blk, unsigned long visited);
63 * Mark an extended block as visited in a graph.
65 void mark_extbb_visited(ir_extblk *blk);
68 * Returns non-zero if an extended was visited.
70 int extbb_visited(const ir_extblk *blk);
73 * Returns non-zero if an extended block was NOT visited.
75 int extbb_not_visited(const ir_extblk *blk);
78 * Returns the link field of an extended block.
80 void *get_extbb_link(const ir_extblk *blk);
83 * Sets the link field of an extended block.
85 void set_extbb_link(ir_extblk *blk, void *link);
88 * Return the number of basic blocks of an extended block.
90 int get_extbb_n_blocks(const ir_extblk *blk);
93 * Return the i'th basic block of an extended block.
95 ir_node *get_extbb_block(ir_extblk *blk, int pos);
98 * Return the leader basis block of an extended block.
100 ir_node *get_extbb_leader(ir_extblk *blk);
103 * Return the node number of an extended block.
104 * Its the block number of the leader block
106 long get_extbb_node_nr(ir_extblk *blk);
108 #endif /* _IREXTBB_H_ */