diff options
author | Jason Ekstrand <[email protected]> | 2016-04-26 18:34:19 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-04-28 15:54:48 -0700 |
commit | 707e72f13bb78869ee95d3286980bf1709cba6cf (patch) | |
tree | 351ee47ca2ac2b54fb7ef0e8effa65a6e81b2c80 /src/compiler/nir/nir_control_flow.c | |
parent | 261d62de33b6192ec31f034a9897d034a37fa582 (diff) |
nir: Switch the arguments to nir_foreach_instr
This matches the "foreach x in container" pattern found in many other
programming languages. Generated by the following regular expression:
s/nir_foreach_instr(\([^,]*\),\s*\([^,]*\))/nir_foreach_instr(\2, \1)/
and similar expressions for nir_foreach_instr_safe etc.
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_control_flow.c')
-rw-r--r-- | src/compiler/nir/nir_control_flow.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/nir/nir_control_flow.c b/src/compiler/nir/nir_control_flow.c index ea5741288ce..64d9a86cde7 100644 --- a/src/compiler/nir/nir_control_flow.c +++ b/src/compiler/nir/nir_control_flow.c @@ -241,7 +241,7 @@ split_block_beginning(nir_block *block) * sourcse will be messed up. This will reverse the order of the phi's, but * order shouldn't matter. */ - nir_foreach_instr_safe(block, instr) { + nir_foreach_instr_safe(instr, block) { if (instr->type != nir_instr_type_phi) break; @@ -256,7 +256,7 @@ split_block_beginning(nir_block *block) static void rewrite_phi_preds(nir_block *block, nir_block *old_pred, nir_block *new_pred) { - nir_foreach_instr_safe(block, instr) { + nir_foreach_instr_safe(instr, block) { if (instr->type != nir_instr_type_phi) break; @@ -274,7 +274,7 @@ static void insert_phi_undef(nir_block *block, nir_block *pred) { nir_function_impl *impl = nir_cf_node_get_function(&block->cf_node); - nir_foreach_instr(block, instr) { + nir_foreach_instr(instr, block) { if (instr->type != nir_instr_type_phi) break; @@ -404,7 +404,7 @@ split_block_before_instr(nir_instr *instr) assert(instr->type != nir_instr_type_phi); nir_block *new_block = split_block_beginning(instr->block); - nir_foreach_instr_safe(instr->block, cur_instr) { + nir_foreach_instr_safe(cur_instr, instr->block) { if (cur_instr == instr) break; @@ -537,7 +537,7 @@ nir_handle_add_jump(nir_block *block) static void remove_phi_src(nir_block *block, nir_block *pred) { - nir_foreach_instr(block, instr) { + nir_foreach_instr(instr, block) { if (instr->type != nir_instr_type_phi) break; @@ -706,7 +706,7 @@ cleanup_cf_node(nir_cf_node *node, nir_function_impl *impl) case nir_cf_node_block: { nir_block *block = nir_cf_node_as_block(node); /* We need to walk the instructions and clean up defs/uses */ - nir_foreach_instr_safe(block, instr) { + nir_foreach_instr_safe(instr, block) { if (instr->type == nir_instr_type_jump) { nir_jump_type jump_type = nir_instr_as_jump(instr)->type; unlink_jump(block, jump_type, false); |