X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Firdom.h;h=07ec40448608d5cd4384d20591ad1f78be1baab9;hb=3c4872fdbca09b88b377417d58981c6e518313b4;hp=fadfe750268d76e8f495302caedded1454c08a75;hpb=c84df20a77cee7031432836dc18d7cf0f7c6bc23;p=libfirm diff --git a/ir/ana/irdom.h b/ir/ana/irdom.h index fadfe7502..07ec40448 100644 --- a/ir/ana/irdom.h +++ b/ir/ana/irdom.h @@ -34,7 +34,7 @@ # include "irnode.h" -/** Accessing the dominator datastructure. +/** Accessing the dominator data structure. * * These routines only work properly if the ir_graph is in state * dom_consistent or dom_inconsistent. @@ -51,8 +51,9 @@ int get_Block_pre_num(const ir_node *bl); void set_Block_pre_num(ir_node *bl, int num); /** - * Get the pre-order number of a block resulting from a dfs walk - * over the dominator tree. + * Get the pre-order number of a block resulting from a + * Depth-First-Search walkover the dominator tree. + * * @param bl The block. * @return The pre-order number. */ @@ -88,6 +89,16 @@ ir_node *get_Block_dominated_first(const ir_node *bl); */ ir_node *get_Block_dominated_next(const ir_node *dom); +/** + * Iterate over all nodes which are immediately dominated by a given + * node. + * @param bl The block whose dominated blocks shall be iterated on. + * @param curr An iterator variable of type ir_node* + */ +#define dominates_for_each(bl,curr) \ + for(curr = get_Block_dominated_first(bl); curr; \ + curr = get_Block_dominated_next(curr)) + /** * Check, if a block dominates another block. * @param a The first block. @@ -119,7 +130,7 @@ void dom_tree_walk(ir_node *n, irg_walk_func *pre, void dom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env); -/* ------------ Building and Removing the dominator datasturcture ----------- */ +/* ------------ Building and Removing the dominator data structure ----------- */ /** Computes the dominator trees. * @@ -128,15 +139,17 @@ void dom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre, * "dom_inconsistent". * Does not compute dominator information for control dead code. Blocks * not reachable from Start contain the following information: + * @code * idom = NULL; * dom_depth = -1; * pre_num = -1; + * @endcode * Also constructs outs information. As this information is correct after * the run does not free the outs information. */ void compute_doms(ir_graph *irg); -/** Frees the dominator datastructures. Sets the flag in irg to "dom_none". */ +/** Frees the dominator data structures. Sets the flag in irg to "dom_none". */ void free_dom_and_peace(ir_graph *irg); #endif /* _IRDOM_H_ */