foreach_if(nir_if *if_stmt, nir_foreach_block_cb cb, bool reverse, void *state)
{
if (reverse) {
- foreach_list_typed_reverse(nir_cf_node, node, node, &if_stmt->else_list) {
+ foreach_list_typed_safe_reverse(nir_cf_node, node, node,
+ &if_stmt->else_list) {
if (!foreach_cf_node(node, cb, reverse, state))
return false;
}
- foreach_list_typed_reverse(nir_cf_node, node, node, &if_stmt->then_list) {
+ foreach_list_typed_safe_reverse(nir_cf_node, node, node,
+ &if_stmt->then_list) {
if (!foreach_cf_node(node, cb, reverse, state))
return false;
}
} else {
- foreach_list_typed(nir_cf_node, node, node, &if_stmt->then_list) {
+ foreach_list_typed_safe(nir_cf_node, node, node, &if_stmt->then_list) {
if (!foreach_cf_node(node, cb, reverse, state))
return false;
}
- foreach_list_typed(nir_cf_node, node, node, &if_stmt->else_list) {
+ foreach_list_typed_safe(nir_cf_node, node, node, &if_stmt->else_list) {
if (!foreach_cf_node(node, cb, reverse, state))
return false;
}
foreach_loop(nir_loop *loop, nir_foreach_block_cb cb, bool reverse, void *state)
{
if (reverse) {
- foreach_list_typed_reverse(nir_cf_node, node, node, &loop->body) {
+ foreach_list_typed_safe_reverse(nir_cf_node, node, node, &loop->body) {
if (!foreach_cf_node(node, cb, reverse, state))
return false;
}
} else {
- foreach_list_typed(nir_cf_node, node, node, &loop->body) {
+ foreach_list_typed_safe(nir_cf_node, node, node, &loop->body) {
if (!foreach_cf_node(node, cb, reverse, state))
return false;
}
bool
nir_foreach_block(nir_function_impl *impl, nir_foreach_block_cb cb, void *state)
{
- foreach_list_typed(nir_cf_node, node, node, &impl->body) {
+ foreach_list_typed_safe(nir_cf_node, node, node, &impl->body) {
if (!foreach_cf_node(node, cb, false, state))
return false;
}
if (!cb(impl->end_block, state))
return false;
- foreach_list_typed_reverse(nir_cf_node, node, node, &impl->body) {
+ foreach_list_typed_safe_reverse(nir_cf_node, node, node, &impl->body) {
if (!foreach_cf_node(node, cb, true, state))
return false;
}