missing include added
[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 #ifndef _IR_EXTBB_TYPEDEF_
26 #define _IR_EXTBB_TYPEDEF_
27 typedef struct _ir_extblk ir_extblk;
28 #endif
29
30 /** Flags for extended basic block state. */
31 typedef enum {
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;
36
37 /**
38  * Compute the extended basic blocks for a graph
39  */
40 void compute_extbb(ir_graph *irg);
41
42 /**
43  * free all extended block info
44  */
45 void free_extbb(ir_graph *irg);
46
47 /**
48  * Return the extended block of a node.
49  */
50 ir_extblk *get_nodes_extbb(ir_node *node);
51
52 /**
53  * Gets the visited counter of an extended block.
54  */
55 unsigned long get_extbb_visited(const ir_extblk *blk);
56
57 /**
58  * Sets the visited counter of an extended block.
59  */
60 void set_extbb_visited(ir_extblk *blk, unsigned long visited);
61
62 /**
63  * Mark an extended block as visited in a graph.
64  */
65 void mark_extbb_visited(ir_extblk *blk);
66
67 /**
68  * Returns non-zero if an extended was visited.
69  */
70 int extbb_visited(const ir_extblk *blk);
71
72 /**
73  * Returns non-zero if an extended block was NOT visited.
74  */
75 int extbb_not_visited(const ir_extblk *blk);
76
77 /**
78  * Returns the link field of an extended block.
79  */
80 void *get_extbb_link(const ir_extblk *blk);
81
82 /**
83  * Sets the link field of an extended block.
84  */
85 void set_extbb_link(ir_extblk *blk, void *link);
86
87 /**
88  * Return the number of basic blocks of an extended block.
89  */
90 int get_extbb_n_blocks(const ir_extblk *blk);
91
92 /**
93  * Return the i'th basic block of an extended block.
94  */
95 ir_node *get_extbb_block(ir_extblk *blk, int pos);
96
97 /**
98  * Return the leader basis block of an extended block.
99  */
100 ir_node *get_extbb_leader(ir_extblk *blk);
101
102 /**
103  * Return the node number of an extended block.
104  * Its the block number of the leader block
105  */
106 long get_extbb_node_nr(ir_extblk *blk);
107
108 #endif /* _IREXTBB_H_ */