1 /* Copyright (C) 2002 by Universitaet Karlsruhe
4 * Authors: Goetz Lindenmaier
6 * irdom.h: This file contains routines to construct and access dominator
8 * The dominator information is stored in three fields of block nodes:
9 * idom: a reference to the block that is the immediate dominator of
11 * dom_depth: a number giving the depth of the block in the dominator
13 * pre_num: Number in preorder traversal.
25 /**********************************************************************/
26 /** Accessing the dopminator datastructure. **/
27 /** These routines only work properly if the ir_graph is in state **/
28 /** dom_consistent or dom_inconsistent. **/
29 /**********************************************************************/
31 ir_node *get_Block_idom(ir_node *bl);
32 void set_Block_idom(ir_node *bl, ir_node *n);
34 int get_Block_dom_depth(ir_node *bl);
35 void set_Block_dom_depth(ir_node *bl, int depth);
37 int get_Block_pre_num(ir_node *bl);
38 void set_Block_pre_num(ir_node *bl, int num);
41 /**********************************************************************/
42 /* Building and Removing the dominator datasturcture **/
43 /**********************************************************************/
45 /* Computes the dominator trees. Sets a flag in irg to "dom_consistent".
46 If the control flow of the graph is changed this flag must be set to
48 Does not compute dominator information for control dead code. Blocks
49 not reachable from Start contain the following information:
53 void compute_doms(ir_graph *irg);
55 /* Frees the dominator datastructures. Sets the flag in irg to "no_dom". */
56 void free_dom_and_peace(ir_graph *irg);
58 #endif /* _IRDOM_H_ */