Commit 1ebb96b9 authored by Matthias Braun's avatar Matthias Braun
Browse files

irdom: move for_each macros to internal API

parent bcf76b40
...@@ -109,26 +109,6 @@ FIRM_API ir_node *get_Block_dominated_next(const ir_node *node); ...@@ -109,26 +109,6 @@ FIRM_API ir_node *get_Block_dominated_next(const ir_node *node);
*/ */
FIRM_API ir_node *get_Block_postdominated_next(const ir_node *node); FIRM_API ir_node *get_Block_postdominated_next(const ir_node *node);
/**
* 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))
/**
* Iterate over all nodes which are immediately post dominated by a given
* node.
* @param bl The block whose post dominated blocks shall be iterated on.
* @param curr An iterator variable of type ir_node*
*/
#define postdominates_for_each(bl,curr) \
for(curr = get_Block_postdominated_first(bl); curr; \
curr = get_Block_postdominated_next(curr))
/** /**
* Returns the smallest common dominator block of two nodes. * Returns the smallest common dominator block of two nodes.
* @param a A node. * @param a A node.
......
...@@ -59,4 +59,24 @@ unsigned get_Block_pdom_max_subtree_pre_num(const ir_node *bl); ...@@ -59,4 +59,24 @@ unsigned get_Block_pdom_max_subtree_pre_num(const ir_node *bl);
void ir_free_dominance_frontiers(ir_graph *irg); void ir_free_dominance_frontiers(ir_graph *irg);
/**
* Iterate over all nodes which are immediately dominated by a given
* node.
* @param block The block whose dominated blocks shall be iterated on.
* @param curr Name for an ir_node* iterator variable (will be declared)
*/
#define dominates_for_each(block, curr) \
for(ir_node *curr = get_Block_dominated_first(block); curr != NULL; \
curr = get_Block_dominated_next(curr))
/**
* Iterate over all nodes which are immediately post dominated by a given
* node.
* @param block The block whose post dominated blocks shall be iterated on.
* @param curr Name for an ir_node *iterator variable (will be declared)
*/
#define postdominates_for_each(block, curr) \
for(ir_node *curr = get_Block_postdominated_first(block); curr != NULL; \
curr = get_Block_postdominated_next(curr))
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment