Added test name
[libfirm] / ir / ana / irdom.h
1 /* Copyright (C) 2002 by Universitaet Karlsruhe
2 * All rights reserved.
3 *
4 */
5
6 /**
7 * @file irdom.h
8 *
9 *   This file contains routines to construct and access dominator information.
10 *
11 *   The dominator information is stored in three fields of block nodes:
12 *     - idom: a reference to the block that is the immediate dominator of
13 *       this block.
14 *     - dom_depth: a number giving the depth of the block in the dominator
15 *       tree.
16 *     - pre_num:  Number in preorder traversal.
17 *
18 * @author Goetz Lindenmaier
19 */
20
21 /* $Id$ */
22
23 # ifndef _IRDOM_H_
24 # define _IRDOM_H_
25
26 # include "irgraph.h"
27 # include "irnode.h"
28
29
30 /* Accessing the dominator datastructure.
31  *
32  * These routines only work properly if the ir_graph is in state
33  * dom_consistent or dom_inconsistent.
34  */
35 ir_node *get_Block_idom(ir_node *bl);
36 void set_Block_idom(ir_node *bl, ir_node *n);
37
38 int get_Block_dom_depth(ir_node *bl);
39 void set_Block_dom_depth(ir_node *bl, int depth);
40
41 int get_Block_pre_num(ir_node *bl);
42 void set_Block_pre_num(ir_node *bl, int num);
43
44
45 /* ------------ Building and Removing the dominator datasturcture ----------- */
46
47 /** Computes the dominator trees.
48  *
49  * Sets a flag in irg to "dom_consistent".
50  * If the control flow of the graph is changed this flag must be set to
51  * "dom_inconsistent".
52  * Does not compute dominator information for control dead code.  Blocks
53  * not reachable from Start contain the following information:
54  *   idom = NULL;
55  *   dom_depth = -1;
56  *   pre_num = -1;
57  */
58 void compute_doms(ir_graph *irg);
59
60 /** Frees the dominator datastructures.  Sets the flag in irg to "no_dom". */
61 void free_dom_and_peace(ir_graph *irg);
62
63 #endif /* _IRDOM_H_ */