added the extened basic block to the Block attributes,
[libfirm] / ir / ana / irextbb.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/ana/irextbb.h
4  * Purpose:     Extended basis block support.
5  * Author:      Michael Beck
6  * Modified by:
7  * Created:     5.2005
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 2002-2005 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13 /**
14  * @file irextbb.h
15  *
16  *  Computes extended basic blocks.
17  *
18  *  @author Michael Beck
19  */
20 #ifndef _IREXTBB_H_
21 #define _IREXTBB_H_
22
23 #include "irgraph.h"
24
25 typedef struct _ir_extblk ir_extblk;
26
27 /** Flags for extended basic block state. */
28 typedef enum {
29   ir_extblk_info_none    = 0,  /**< No extended basic block information is constructed. Default. */
30   ir_extblk_info_valid   = 1,  /**< Extended basic block information is valid. */
31   ir_extblk_info_invalid = 2,  /**< Extended basic block information is constructed but invalid. */
32 } irg_extblk_info_state;
33
34 /**
35  * Compute the extended basic blocks for a graph
36  */
37 void compute_extbb(ir_graph *irg);
38
39 /**
40  * free all extended block info
41  */
42 void free_extbb(ir_graph *irg);
43
44 /**
45  * Return the extended block of a node.
46  */
47 ir_extblk *get_nodes_extbb(ir_node *node);
48
49 /**
50  * Gets the visited counter of an extended block.
51  */
52 unsigned long get_extbb_visited(const ir_extblk *blk);
53
54 /**
55  * Sets the visited counter of an extended block.
56  */
57 void set_extbb_visited(ir_extblk *blk, unsigned long visited);
58
59 /**
60  * Mark an extended block as visited in a graph.
61  */
62 void mark_extbb_visited(ir_extblk *blk);
63
64 /**
65  * Returns non-zero if an extended was visited.
66  */
67 int extbb_visited(const ir_extblk *blk);
68
69 /**
70  * Returns non-zero if an extended block was NOT visited.
71  */
72 int extbb_not_visited(const ir_extblk *blk);
73
74 /**
75  * Returns the link field of an extended block.
76  */
77 void *get_extbb_link(const ir_extblk *blk);
78
79 /**
80  * Sets the link field of an extended block.
81  */
82 void set_extbb_link(ir_extblk *blk, void *link);
83
84 /**
85  * Return the number of basis blocks of an extended block
86  */
87 int get_extbb_n_blocks(const ir_extblk *blk);
88
89 /**
90  * Return the i'th basis block of an extended block
91  */
92 ir_node *get_extbb_block(ir_extblk *blk, int pos);
93
94
95 #endif /* _IREXTBB_H_ */