nir: add a helper for iterating over blocks in a cf node

We were already doing this internally for iterating over a function
implementation, so just expose it directly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Connor Abbott
2015-05-08 14:40:58 -04:00
committed by Kenneth Graunke
parent 89dc0626bd
commit 019eea1c4f
2 changed files with 9 additions and 0 deletions
+7
View File
@@ -1292,6 +1292,13 @@ foreach_cf_node(nir_cf_node *node, nir_foreach_block_cb cb,
return false;
}
bool
nir_foreach_block_in_cf_node(nir_cf_node *node, nir_foreach_block_cb cb,
void *state)
{
return foreach_cf_node(node, cb, false, state);
}
bool
nir_foreach_block(nir_function_impl *impl, nir_foreach_block_cb cb, void *state)
{
+2
View File
@@ -1726,6 +1726,8 @@ bool nir_foreach_block(nir_function_impl *impl, nir_foreach_block_cb cb,
void *state);
bool nir_foreach_block_reverse(nir_function_impl *impl, nir_foreach_block_cb cb,
void *state);
bool nir_foreach_block_in_cf_node(nir_cf_node *node, nir_foreach_block_cb cb,
void *state);
/* If the following CF node is an if, this function returns that if.
* Otherwise, it returns NULL.