summaryrefslogtreecommitdiff
path: root/src/compiler/nir/nir_repair_ssa.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-04-26 20:30:10 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-04-28 15:54:48 -0700
commit5015260a0598ada4865b2c6086fc669505f64749 (patch)
tree5525c401e8a64983d4db83fd08d61209aae24700 /src/compiler/nir/nir_repair_ssa.c
parent9464d8c49813aba77285e7465b96e92a91ed327c (diff)
nir: Switch the arguments to nir_foreach_use and friends
This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_use(\([^,]*\),\s*\([^,]*\))/nir_foreach_use(\2, \1)/ and similar expressions for nir_foreach_use_safe, etc. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/compiler/nir/nir_repair_ssa.c')
-rw-r--r--src/compiler/nir/nir_repair_ssa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_repair_ssa.c b/src/compiler/nir/nir_repair_ssa.c
index 7dd23979fcd9..b4d22d91c271 100644
--- a/src/compiler/nir/nir_repair_ssa.c
+++ b/src/compiler/nir/nir_repair_ssa.c
@@ -70,7 +70,7 @@ repair_ssa_def(nir_ssa_def *def, void *void_state)
struct repair_ssa_state *state = void_state;
bool is_valid = true;
- nir_foreach_use(def, src) {
+ nir_foreach_use(src, def) {
if (!nir_block_dominates(def->parent_instr->block, get_src_block(src))) {
is_valid = false;
break;
@@ -90,7 +90,7 @@ repair_ssa_def(nir_ssa_def *def, void *void_state)
nir_phi_builder_value_set_block_def(val, def->parent_instr->block, def);
- nir_foreach_use_safe(def, src) {
+ nir_foreach_use_safe(src, def) {
nir_block *src_block = get_src_block(src);
if (!nir_block_dominates(def->parent_instr->block, src_block)) {
nir_instr_rewrite_src(src->parent_instr, src, nir_src_for_ssa(