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:
committed by
Kenneth Graunke
parent
89dc0626bd
commit
019eea1c4f
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user