3 * File name: ir/ana/irdom.h
4 * Purpose: Construct and access dominator tree.
5 * Author: Goetz Lindenmaier
9 * Copyright: (c) 2002-2003 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
16 * This file contains routines to construct and access dominator information.
18 * The dominator information is stored in three fields of block nodes:
19 * - idom: a reference to the block that is the immediate dominator of
21 * - dom_depth: a number giving the depth of the block in the dominator
23 * - pre_num: Number in preorder traversal.
25 * @author Goetz Lindenmaier
36 /* Accessing the dominator datastructure.
38 * These routines only work properly if the ir_graph is in state
39 * dom_consistent or dom_inconsistent.
41 ir_node *get_Block_idom(ir_node *bl);
42 void set_Block_idom(ir_node *bl, ir_node *n);
44 int get_Block_dom_depth(ir_node *bl);
45 void set_Block_dom_depth(ir_node *bl, int depth);
47 int get_Block_pre_num(ir_node *bl);
48 void set_Block_pre_num(ir_node *bl, int num);
51 /* ------------ Building and Removing the dominator datasturcture ----------- */
53 /** Computes the dominator trees.
55 * Sets a flag in irg to "dom_consistent".
56 * If the control flow of the graph is changed this flag must be set to
58 * Does not compute dominator information for control dead code. Blocks
59 * not reachable from Start contain the following information:
64 void compute_doms(ir_graph *irg);
66 /** Frees the dominator datastructures. Sets the flag in irg to "no_dom". */
67 void free_dom_and_peace(ir_graph *irg);
69 #endif /* _IRDOM_H_ */