From 5015260a0598ada4865b2c6086fc669505f64749 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 26 Apr 2016 20:30:10 -0700 Subject: 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 --- src/compiler/nir/nir.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/compiler/nir/nir.c') diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index 0a8b0836ab0..867a43cefbd 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -1419,10 +1419,10 @@ nir_ssa_def_rewrite_uses(nir_ssa_def *def, nir_src new_src) { assert(!new_src.is_ssa || def != new_src.ssa); - nir_foreach_use_safe(def, use_src) + nir_foreach_use_safe(use_src, def) nir_instr_rewrite_src(use_src->parent_instr, use_src, new_src); - nir_foreach_if_use_safe(def, use_src) + nir_foreach_if_use_safe(use_src, def) nir_if_rewrite_condition(use_src->parent_if, new_src); } @@ -1462,7 +1462,7 @@ nir_ssa_def_rewrite_uses_after(nir_ssa_def *def, nir_src new_src, { assert(!new_src.is_ssa || def != new_src.ssa); - nir_foreach_use_safe(def, use_src) { + nir_foreach_use_safe(use_src, def) { assert(use_src->parent_instr != def->parent_instr); /* Since def already dominates all of its uses, the only way a use can * not be dominated by after_me is if it is between def and after_me in @@ -1472,7 +1472,7 @@ nir_ssa_def_rewrite_uses_after(nir_ssa_def *def, nir_src new_src, nir_instr_rewrite_src(use_src->parent_instr, use_src, new_src); } - nir_foreach_if_use_safe(def, use_src) + nir_foreach_if_use_safe(use_src, def) nir_if_rewrite_condition(use_src->parent_if, new_src); } @@ -1480,7 +1480,7 @@ uint8_t nir_ssa_def_components_read(nir_ssa_def *def) { uint8_t read_mask = 0; - nir_foreach_use(def, use) { + nir_foreach_use(use, def) { if (use->parent_instr->type == nir_instr_type_alu) { nir_alu_instr *alu = nir_instr_as_alu(use->parent_instr); nir_alu_src *alu_src = exec_node_data(nir_alu_src, use, src); -- cgit v1.2.3