summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_instr_set.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-04-26 20:16:21 -0700
committerJason Ekstrand <[email protected]>2016-04-28 15:54:48 -0700
commit8564916d01b31ca5665a27366e483738541ba5a3 (patch)
tree5b0563e838824f90ed398c0bf64ab3e3339fe7ce /src/compiler/nir/nir_instr_set.c
parent707e72f13bb78869ee95d3286980bf1709cba6cf (diff)
nir: Switch the arguments to nir_foreach_phi_src
This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_phi_src(\([^,]*\),\s*\([^,]*\))/nir_foreach_phi_src(\2, \1)/ and a similar expression for nir_foreach_phi_src_safe. Reviewed-by: Eduardo Lima Mitev <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_instr_set.c')
-rw-r--r--src/compiler/nir/nir_instr_set.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_instr_set.c b/src/compiler/nir/nir_instr_set.c
index c6161433516..fe312a048bd 100644
--- a/src/compiler/nir/nir_instr_set.c
+++ b/src/compiler/nir/nir_instr_set.c
@@ -106,7 +106,7 @@ hash_phi(uint32_t hash, const nir_phi_instr *instr)
unsigned num_preds = instr->instr.block->predecessors->entries;
NIR_VLA(nir_phi_src *, srcs, num_preds);
unsigned i = 0;
- nir_foreach_phi_src(instr, src) {
+ nir_foreach_phi_src(src, instr) {
srcs[i++] = src;
}
@@ -343,8 +343,8 @@ nir_instrs_equal(const nir_instr *instr1, const nir_instr *instr2)
if (phi1->instr.block != phi2->instr.block)
return false;
- nir_foreach_phi_src(phi1, src1) {
- nir_foreach_phi_src(phi2, src2) {
+ nir_foreach_phi_src(src1, phi1) {
+ nir_foreach_phi_src(src2, phi2) {
if (src1->pred == src2->pred) {
if (!nir_srcs_equal(src1->src, src2->src))
return false;