summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-04-26 20:26:42 -0700
committerJason Ekstrand <[email protected]>2016-04-28 15:54:48 -0700
commit9464d8c49813aba77285e7465b96e92a91ed327c (patch)
treee39fa6395b6e5fd1eba81fb1520cf047c91cd5f2 /src/compiler
parente63766fb4b54bc88756ee7e82c3ff8cec0dc5561 (diff)
nir: Switch the arguments to nir_foreach_function
This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_function(\([^,]*\),\s*\([^,]*\))/nir_foreach_function(\2, \1)/ Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir.h2
-rw-r--r--src/compiler/nir/nir_algebraic.py2
-rw-r--r--src/compiler/nir/nir_clone.c2
-rw-r--r--src/compiler/nir/nir_dominance.c8
-rw-r--r--src/compiler/nir/nir_from_ssa.c2
-rw-r--r--src/compiler/nir/nir_gs_count_vertices.c2
-rw-r--r--src/compiler/nir/nir_inline_functions.c2
-rw-r--r--src/compiler/nir/nir_lower_alu_to_scalar.c2
-rw-r--r--src/compiler/nir/nir_lower_atomics.c2
-rw-r--r--src/compiler/nir/nir_lower_clip.c6
-rw-r--r--src/compiler/nir/nir_lower_double_ops.c2
-rw-r--r--src/compiler/nir/nir_lower_double_packing.c2
-rw-r--r--src/compiler/nir/nir_lower_global_vars_to_local.c2
-rw-r--r--src/compiler/nir/nir_lower_gs_intrinsics.c2
-rw-r--r--src/compiler/nir/nir_lower_idiv.c2
-rw-r--r--src/compiler/nir/nir_lower_indirect_derefs.c2
-rw-r--r--src/compiler/nir/nir_lower_io.c2
-rw-r--r--src/compiler/nir/nir_lower_load_const_to_scalar.c2
-rw-r--r--src/compiler/nir/nir_lower_locals_to_regs.c2
-rw-r--r--src/compiler/nir/nir_lower_outputs_to_temporaries.c2
-rw-r--r--src/compiler/nir/nir_lower_phis_to_scalar.c2
-rw-r--r--src/compiler/nir/nir_lower_returns.c2
-rw-r--r--src/compiler/nir/nir_lower_samplers.c2
-rw-r--r--src/compiler/nir/nir_lower_system_values.c2
-rw-r--r--src/compiler/nir/nir_lower_tex.c2
-rw-r--r--src/compiler/nir/nir_lower_to_source_mods.c2
-rw-r--r--src/compiler/nir/nir_lower_two_sided_color.c2
-rw-r--r--src/compiler/nir/nir_lower_var_copies.c2
-rw-r--r--src/compiler/nir/nir_lower_vars_to_ssa.c2
-rw-r--r--src/compiler/nir/nir_lower_vec_to_movs.c2
-rw-r--r--src/compiler/nir/nir_metadata.c4
-rw-r--r--src/compiler/nir/nir_move_vec_src_uses_to_dest.c2
-rw-r--r--src/compiler/nir/nir_normalize_cubemap_coords.c2
-rw-r--r--src/compiler/nir/nir_opt_constant_folding.c2
-rw-r--r--src/compiler/nir/nir_opt_copy_propagate.c2
-rw-r--r--src/compiler/nir/nir_opt_cse.c2
-rw-r--r--src/compiler/nir/nir_opt_dce.c2
-rw-r--r--src/compiler/nir/nir_opt_dead_cf.c2
-rw-r--r--src/compiler/nir/nir_opt_gcm.c2
-rw-r--r--src/compiler/nir/nir_opt_peephole_select.c2
-rw-r--r--src/compiler/nir/nir_opt_remove_phis.c2
-rw-r--r--src/compiler/nir/nir_opt_undef.c2
-rw-r--r--src/compiler/nir/nir_remove_dead_variables.c4
-rw-r--r--src/compiler/nir/nir_repair_ssa.c2
-rw-r--r--src/compiler/nir/nir_split_var_copies.c2
-rw-r--r--src/compiler/nir/nir_to_ssa.c2
46 files changed, 53 insertions, 53 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index a76718d85de..da502bf05c0 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -1820,7 +1820,7 @@ nir_shader_get_entrypoint(nir_shader *shader)
return func;
}
-#define nir_foreach_function(shader, func) \
+#define nir_foreach_function(func, shader) \
foreach_list_typed(nir_function, func, node, &(shader)->functions)
nir_shader *nir_shader_create(void *mem_ctx,
diff --git a/src/compiler/nir/nir_algebraic.py b/src/compiler/nir/nir_algebraic.py
index e61f5d2184e..285f8534846 100644
--- a/src/compiler/nir/nir_algebraic.py
+++ b/src/compiler/nir/nir_algebraic.py
@@ -584,7 +584,7 @@ ${pass_name}(nir_shader *shader)
condition_flags[${index}] = ${condition};
% endfor
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress |= ${pass_name}_impl(function->impl, condition_flags);
}
diff --git a/src/compiler/nir/nir_clone.c b/src/compiler/nir/nir_clone.c
index 18272235564..0e397b03821 100644
--- a/src/compiler/nir/nir_clone.c
+++ b/src/compiler/nir/nir_clone.c
@@ -701,7 +701,7 @@ nir_shader_clone(void *mem_ctx, const nir_shader *s)
* functions of other functions and we don't know what order the functions
* will have in the list.
*/
- nir_foreach_function(s, fxn) {
+ nir_foreach_function(fxn, s) {
nir_function *nfxn = remap_global(&state, fxn);
nfxn->impl = clone_function_impl(&state, fxn->impl);
nfxn->impl->function = nfxn;
diff --git a/src/compiler/nir/nir_dominance.c b/src/compiler/nir/nir_dominance.c
index 8803be31d88..1781cdcc6f4 100644
--- a/src/compiler/nir/nir_dominance.c
+++ b/src/compiler/nir/nir_dominance.c
@@ -198,7 +198,7 @@ nir_calc_dominance_impl(nir_function_impl *impl)
void
nir_calc_dominance(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
nir_calc_dominance_impl(function->impl);
}
@@ -258,7 +258,7 @@ nir_dump_dom_tree_impl(nir_function_impl *impl, FILE *fp)
void
nir_dump_dom_tree(nir_shader *shader, FILE *fp)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
nir_dump_dom_tree_impl(function->impl, fp);
}
@@ -281,7 +281,7 @@ nir_dump_dom_frontier_impl(nir_function_impl *impl, FILE *fp)
void
nir_dump_dom_frontier(nir_shader *shader, FILE *fp)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
nir_dump_dom_frontier_impl(function->impl, fp);
}
@@ -305,7 +305,7 @@ nir_dump_cfg_impl(nir_function_impl *impl, FILE *fp)
void
nir_dump_cfg(nir_shader *shader, FILE *fp)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
nir_dump_cfg_impl(function->impl, fp);
}
diff --git a/src/compiler/nir/nir_from_ssa.c b/src/compiler/nir/nir_from_ssa.c
index 067e66fe86a..15e89a3e45f 100644
--- a/src/compiler/nir/nir_from_ssa.c
+++ b/src/compiler/nir/nir_from_ssa.c
@@ -805,7 +805,7 @@ nir_convert_from_ssa_impl(nir_function_impl *impl, bool phi_webs_only)
void
nir_convert_from_ssa(nir_shader *shader, bool phi_webs_only)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
nir_convert_from_ssa_impl(function->impl, phi_webs_only);
}
diff --git a/src/compiler/nir/nir_gs_count_vertices.c b/src/compiler/nir/nir_gs_count_vertices.c
index 9e7c4a11c12..7342e4473df 100644
--- a/src/compiler/nir/nir_gs_count_vertices.c
+++ b/src/compiler/nir/nir_gs_count_vertices.c
@@ -55,7 +55,7 @@ nir_gs_count_vertices(const nir_shader *shader)
{
int count = -1;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (!function->impl)
continue;
diff --git a/src/compiler/nir/nir_inline_functions.c b/src/compiler/nir/nir_inline_functions.c
index c56dc3c09c7..4641e8cc20e 100644
--- a/src/compiler/nir/nir_inline_functions.c
+++ b/src/compiler/nir/nir_inline_functions.c
@@ -252,7 +252,7 @@ nir_inline_functions(nir_shader *shader)
_mesa_key_pointer_equal);
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress = inline_function_impl(function->impl, inlined) || progress;
}
diff --git a/src/compiler/nir/nir_lower_alu_to_scalar.c b/src/compiler/nir/nir_lower_alu_to_scalar.c
index ddf5eb5c1cb..b4917912373 100644
--- a/src/compiler/nir/nir_lower_alu_to_scalar.c
+++ b/src/compiler/nir/nir_lower_alu_to_scalar.c
@@ -257,7 +257,7 @@ nir_lower_alu_to_scalar_impl(nir_function_impl *impl)
void
nir_lower_alu_to_scalar(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
nir_lower_alu_to_scalar_impl(function->impl);
}
diff --git a/src/compiler/nir/nir_lower_atomics.c b/src/compiler/nir/nir_lower_atomics.c
index 1e2d65b9801..04e1febc179 100644
--- a/src/compiler/nir/nir_lower_atomics.c
+++ b/src/compiler/nir/nir_lower_atomics.c
@@ -137,7 +137,7 @@ void
nir_lower_atomics(nir_shader *shader,
const struct gl_shader_program *shader_program)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl) {
nir_foreach_block(block, function->impl) {
nir_foreach_instr_safe(instr, block) {
diff --git a/src/compiler/nir/nir_lower_clip.c b/src/compiler/nir/nir_lower_clip.c
index 25ded166c6b..80db653a428 100644
--- a/src/compiler/nir/nir_lower_clip.c
+++ b/src/compiler/nir/nir_lower_clip.c
@@ -124,7 +124,7 @@ static nir_ssa_def *
find_output(nir_shader *shader, unsigned drvloc)
{
nir_ssa_def *def = NULL;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl) {
nir_foreach_block_reverse(block, function->impl) {
nir_ssa_def *new_def = find_output_in_block(block, drvloc);
@@ -250,7 +250,7 @@ nir_lower_clip_vs(nir_shader *shader, unsigned ucp_enables)
out[1] =
create_clipdist_var(shader, ++maxloc, true, VARYING_SLOT_CLIP_DIST1);
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (!strcmp(function->name, "main"))
lower_clip_vs(function->impl, ucp_enables, cv, out);
}
@@ -324,7 +324,7 @@ nir_lower_clip_fs(nir_shader *shader, unsigned ucp_enables)
create_clipdist_var(shader, ++maxloc, false,
VARYING_SLOT_CLIP_DIST1);
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (!strcmp(function->name, "main"))
lower_clip_fs(function->impl, ucp_enables, in);
}
diff --git a/src/compiler/nir/nir_lower_double_ops.c b/src/compiler/nir/nir_lower_double_ops.c
index 75032a6f766..e5cf094bad0 100644
--- a/src/compiler/nir/nir_lower_double_ops.c
+++ b/src/compiler/nir/nir_lower_double_ops.c
@@ -557,7 +557,7 @@ lower_doubles_impl(nir_function_impl *impl, nir_lower_doubles_options options)
void
nir_lower_doubles(nir_shader *shader, nir_lower_doubles_options options)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
lower_doubles_impl(function->impl, options);
}
diff --git a/src/compiler/nir/nir_lower_double_packing.c b/src/compiler/nir/nir_lower_double_packing.c
index c34c267c0f8..22092a2693f 100644
--- a/src/compiler/nir/nir_lower_double_packing.c
+++ b/src/compiler/nir/nir_lower_double_packing.c
@@ -87,7 +87,7 @@ lower_double_pack_impl(nir_function_impl *impl)
void
nir_lower_double_pack(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
lower_double_pack_impl(function->impl);
}
diff --git a/src/compiler/nir/nir_lower_global_vars_to_local.c b/src/compiler/nir/nir_lower_global_vars_to_local.c
index e118e04b564..c8fdfde8cb1 100644
--- a/src/compiler/nir/nir_lower_global_vars_to_local.c
+++ b/src/compiler/nir/nir_lower_global_vars_to_local.c
@@ -76,7 +76,7 @@ nir_lower_global_vars_to_local(nir_shader *shader)
_mesa_hash_table_create(NULL, _mesa_hash_pointer,
_mesa_key_pointer_equal);
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl) {
nir_foreach_block(block, function->impl)
mark_global_var_uses_block(block, function->impl, var_func_table);
diff --git a/src/compiler/nir/nir_lower_gs_intrinsics.c b/src/compiler/nir/nir_lower_gs_intrinsics.c
index 293aeac8c03..9bbaf836843 100644
--- a/src/compiler/nir/nir_lower_gs_intrinsics.c
+++ b/src/compiler/nir/nir_lower_gs_intrinsics.c
@@ -198,7 +198,7 @@ nir_lower_gs_intrinsics(nir_shader *shader)
exec_list_push_tail(&shader->globals, &var->node);
state.vertex_count_var = var;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl) {
nir_builder b;
nir_builder_init(&b, function->impl);
diff --git a/src/compiler/nir/nir_lower_idiv.c b/src/compiler/nir/nir_lower_idiv.c
index 83e265b7d0d..f2e7cdeb33d 100644
--- a/src/compiler/nir/nir_lower_idiv.c
+++ b/src/compiler/nir/nir_lower_idiv.c
@@ -137,7 +137,7 @@ convert_impl(nir_function_impl *impl)
void
nir_lower_idiv(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
convert_impl(function->impl);
}
diff --git a/src/compiler/nir/nir_lower_indirect_derefs.c b/src/compiler/nir/nir_lower_indirect_derefs.c
index 5c2aac326f8..694a6e0f3d7 100644
--- a/src/compiler/nir/nir_lower_indirect_derefs.c
+++ b/src/compiler/nir/nir_lower_indirect_derefs.c
@@ -227,7 +227,7 @@ nir_lower_indirect_derefs(nir_shader *shader, nir_variable_mode modes)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress = lower_indirects_impl(function->impl, modes) || progress;
}
diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c
index 1c1ad5100a9..d0f3dc72884 100644
--- a/src/compiler/nir/nir_lower_io.c
+++ b/src/compiler/nir/nir_lower_io.c
@@ -414,7 +414,7 @@ void
nir_lower_io(nir_shader *shader, nir_variable_mode modes,
int (*type_size)(const struct glsl_type *))
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
nir_lower_io_impl(function->impl, modes, type_size);
}
diff --git a/src/compiler/nir/nir_lower_load_const_to_scalar.c b/src/compiler/nir/nir_lower_load_const_to_scalar.c
index 4857902f6ab..bd518f920d6 100644
--- a/src/compiler/nir/nir_lower_load_const_to_scalar.c
+++ b/src/compiler/nir/nir_lower_load_const_to_scalar.c
@@ -81,7 +81,7 @@ nir_lower_load_const_to_scalar_impl(nir_function_impl *impl)
void
nir_lower_load_const_to_scalar(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
nir_lower_load_const_to_scalar_impl(function->impl);
}
diff --git a/src/compiler/nir/nir_lower_locals_to_regs.c b/src/compiler/nir/nir_lower_locals_to_regs.c
index f1ad1712552..7c52c161ccb 100644
--- a/src/compiler/nir/nir_lower_locals_to_regs.c
+++ b/src/compiler/nir/nir_lower_locals_to_regs.c
@@ -390,7 +390,7 @@ nir_lower_locals_to_regs(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress = nir_lower_locals_to_regs_impl(function->impl) || progress;
}
diff --git a/src/compiler/nir/nir_lower_outputs_to_temporaries.c b/src/compiler/nir/nir_lower_outputs_to_temporaries.c
index 01031f20adc..d5a0737cf6a 100644
--- a/src/compiler/nir/nir_lower_outputs_to_temporaries.c
+++ b/src/compiler/nir/nir_lower_outputs_to_temporaries.c
@@ -108,7 +108,7 @@ nir_lower_outputs_to_temporaries(nir_shader *shader, nir_function *entrypoint)
exec_list_push_tail(&shader->outputs, &output->node);
}
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl == NULL)
continue;
diff --git a/src/compiler/nir/nir_lower_phis_to_scalar.c b/src/compiler/nir/nir_lower_phis_to_scalar.c
index 0e27e6dd7f4..9fd00cc784a 100644
--- a/src/compiler/nir/nir_lower_phis_to_scalar.c
+++ b/src/compiler/nir/nir_lower_phis_to_scalar.c
@@ -291,7 +291,7 @@ lower_phis_to_scalar_impl(nir_function_impl *impl)
void
nir_lower_phis_to_scalar(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
lower_phis_to_scalar_impl(function->impl);
}
diff --git a/src/compiler/nir/nir_lower_returns.c b/src/compiler/nir/nir_lower_returns.c
index 91bb2f7dfeb..8dbea6e7179 100644
--- a/src/compiler/nir/nir_lower_returns.c
+++ b/src/compiler/nir/nir_lower_returns.c
@@ -237,7 +237,7 @@ nir_lower_returns(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress = nir_lower_returns_impl(function->impl) || progress;
}
diff --git a/src/compiler/nir/nir_lower_samplers.c b/src/compiler/nir/nir_lower_samplers.c
index 43a97236c1b..0de9eb88dfc 100644
--- a/src/compiler/nir/nir_lower_samplers.c
+++ b/src/compiler/nir/nir_lower_samplers.c
@@ -171,7 +171,7 @@ void
nir_lower_samplers(nir_shader *shader,
const struct gl_shader_program *shader_program)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
lower_impl(function->impl, shader_program, shader->stage);
}
diff --git a/src/compiler/nir/nir_lower_system_values.c b/src/compiler/nir/nir_lower_system_values.c
index 0eee89590ec..8310e3831f4 100644
--- a/src/compiler/nir/nir_lower_system_values.c
+++ b/src/compiler/nir/nir_lower_system_values.c
@@ -149,7 +149,7 @@ nir_lower_system_values(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress = convert_impl(function->impl) || progress;
}
diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c
index 2ab5d1c065a..d75e455136b 100644
--- a/src/compiler/nir/nir_lower_tex.c
+++ b/src/compiler/nir/nir_lower_tex.c
@@ -392,7 +392,7 @@ nir_lower_tex(nir_shader *shader, const nir_lower_tex_options *options)
state.options = options;
state.progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
nir_lower_tex_impl(function->impl, &state);
}
diff --git a/src/compiler/nir/nir_lower_to_source_mods.c b/src/compiler/nir/nir_lower_to_source_mods.c
index 6fe8465675d..b5f165002d1 100644
--- a/src/compiler/nir/nir_lower_to_source_mods.c
+++ b/src/compiler/nir/nir_lower_to_source_mods.c
@@ -184,7 +184,7 @@ nir_lower_to_source_mods_block(nir_block *block)
void
nir_lower_to_source_mods(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl) {
nir_foreach_block(block, function->impl) {
nir_lower_to_source_mods_block(block);
diff --git a/src/compiler/nir/nir_lower_two_sided_color.c b/src/compiler/nir/nir_lower_two_sided_color.c
index ba3a4484f0f..ea432c1bb59 100644
--- a/src/compiler/nir/nir_lower_two_sided_color.c
+++ b/src/compiler/nir/nir_lower_two_sided_color.c
@@ -204,7 +204,7 @@ nir_lower_two_sided_color(nir_shader *shader)
if (setup_inputs(&state) != 0)
return;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
nir_lower_two_sided_color_impl(function->impl, &state);
}
diff --git a/src/compiler/nir/nir_lower_var_copies.c b/src/compiler/nir/nir_lower_var_copies.c
index 3fe1c839783..707d5af03ee 100644
--- a/src/compiler/nir/nir_lower_var_copies.c
+++ b/src/compiler/nir/nir_lower_var_copies.c
@@ -182,7 +182,7 @@ lower_var_copies_impl(nir_function_impl *impl)
void
nir_lower_var_copies(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
lower_var_copies_impl(function->impl);
}
diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c b/src/compiler/nir/nir_lower_vars_to_ssa.c
index 00ed56ec7bb..eae40755998 100644
--- a/src/compiler/nir/nir_lower_vars_to_ssa.c
+++ b/src/compiler/nir/nir_lower_vars_to_ssa.c
@@ -752,7 +752,7 @@ nir_lower_vars_to_ssa_impl(nir_function_impl *impl)
void
nir_lower_vars_to_ssa(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
nir_lower_vars_to_ssa_impl(function->impl);
}
diff --git a/src/compiler/nir/nir_lower_vec_to_movs.c b/src/compiler/nir/nir_lower_vec_to_movs.c
index 002ebf3ba2a..90619c9fa3a 100644
--- a/src/compiler/nir/nir_lower_vec_to_movs.c
+++ b/src/compiler/nir/nir_lower_vec_to_movs.c
@@ -300,7 +300,7 @@ nir_lower_vec_to_movs(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress = nir_lower_vec_to_movs_impl(function->impl) || progress;
}
diff --git a/src/compiler/nir/nir_metadata.c b/src/compiler/nir/nir_metadata.c
index 61aae73221e..9e1cff5a67f 100644
--- a/src/compiler/nir/nir_metadata.c
+++ b/src/compiler/nir/nir_metadata.c
@@ -63,7 +63,7 @@ nir_metadata_preserve(nir_function_impl *impl, nir_metadata preserved)
void
nir_metadata_set_validation_flag(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl) {
function->impl->valid_metadata |= nir_metadata_not_properly_reset;
}
@@ -80,7 +80,7 @@ nir_metadata_set_validation_flag(nir_shader *shader)
void
nir_metadata_check_validation_flag(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl) {
assert(!(function->impl->valid_metadata &
nir_metadata_not_properly_reset));
diff --git a/src/compiler/nir/nir_move_vec_src_uses_to_dest.c b/src/compiler/nir/nir_move_vec_src_uses_to_dest.c
index 8edf0913611..30752a2e716 100644
--- a/src/compiler/nir/nir_move_vec_src_uses_to_dest.c
+++ b/src/compiler/nir/nir_move_vec_src_uses_to_dest.c
@@ -193,7 +193,7 @@ nir_move_vec_src_uses_to_dest_impl(nir_shader *shader, nir_function_impl *impl)
void
nir_move_vec_src_uses_to_dest(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
nir_move_vec_src_uses_to_dest_impl(shader, function->impl);
}
diff --git a/src/compiler/nir/nir_normalize_cubemap_coords.c b/src/compiler/nir/nir_normalize_cubemap_coords.c
index 002b9cf13d9..cb25e311d76 100644
--- a/src/compiler/nir/nir_normalize_cubemap_coords.c
+++ b/src/compiler/nir/nir_normalize_cubemap_coords.c
@@ -107,7 +107,7 @@ nir_normalize_cubemap_coords(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress = normalize_cubemap_coords_impl(function->impl) || progress;
}
diff --git a/src/compiler/nir/nir_opt_constant_folding.c b/src/compiler/nir/nir_opt_constant_folding.c
index b10bb234fd3..8f040619bfa 100644
--- a/src/compiler/nir/nir_opt_constant_folding.c
+++ b/src/compiler/nir/nir_opt_constant_folding.c
@@ -220,7 +220,7 @@ nir_opt_constant_folding(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress |= nir_opt_constant_folding_impl(function->impl);
}
diff --git a/src/compiler/nir/nir_opt_copy_propagate.c b/src/compiler/nir/nir_opt_copy_propagate.c
index 6e880778152..adca7fa6eff 100644
--- a/src/compiler/nir/nir_opt_copy_propagate.c
+++ b/src/compiler/nir/nir_opt_copy_propagate.c
@@ -269,7 +269,7 @@ nir_copy_prop(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl && nir_copy_prop_impl(function->impl))
progress = true;
}
diff --git a/src/compiler/nir/nir_opt_cse.c b/src/compiler/nir/nir_opt_cse.c
index 109b62906ed..71953b81bf7 100644
--- a/src/compiler/nir/nir_opt_cse.c
+++ b/src/compiler/nir/nir_opt_cse.c
@@ -83,7 +83,7 @@ nir_opt_cse(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress |= nir_opt_cse_impl(function->impl);
}
diff --git a/src/compiler/nir/nir_opt_dce.c b/src/compiler/nir/nir_opt_dce.c
index f7dd7be950d..0aeb08a320d 100644
--- a/src/compiler/nir/nir_opt_dce.c
+++ b/src/compiler/nir/nir_opt_dce.c
@@ -167,7 +167,7 @@ bool
nir_opt_dce(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl && nir_opt_dce_impl(function->impl))
progress = true;
}
diff --git a/src/compiler/nir/nir_opt_dead_cf.c b/src/compiler/nir/nir_opt_dead_cf.c
index 4b62e55d030..2e04c179073 100644
--- a/src/compiler/nir/nir_opt_dead_cf.c
+++ b/src/compiler/nir/nir_opt_dead_cf.c
@@ -349,7 +349,7 @@ nir_opt_dead_cf(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function)
+ nir_foreach_function(function, shader)
if (function->impl)
progress |= opt_dead_cf_impl(function->impl);
diff --git a/src/compiler/nir/nir_opt_gcm.c b/src/compiler/nir/nir_opt_gcm.c
index a87a0067230..119b74d58bb 100644
--- a/src/compiler/nir/nir_opt_gcm.c
+++ b/src/compiler/nir/nir_opt_gcm.c
@@ -488,7 +488,7 @@ opt_gcm_impl(nir_function_impl *impl)
void
nir_opt_gcm(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
opt_gcm_impl(function->impl);
}
diff --git a/src/compiler/nir/nir_opt_peephole_select.c b/src/compiler/nir/nir_opt_peephole_select.c
index 4d2b74dc7ff..e06820d3e17 100644
--- a/src/compiler/nir/nir_opt_peephole_select.c
+++ b/src/compiler/nir/nir_opt_peephole_select.c
@@ -239,7 +239,7 @@ nir_opt_peephole_select(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress |= nir_opt_peephole_select_impl(function->impl);
}
diff --git a/src/compiler/nir/nir_opt_remove_phis.c b/src/compiler/nir/nir_opt_remove_phis.c
index 5d015c243de..f1e7bb083f3 100644
--- a/src/compiler/nir/nir_opt_remove_phis.c
+++ b/src/compiler/nir/nir_opt_remove_phis.c
@@ -123,7 +123,7 @@ nir_opt_remove_phis(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function)
+ nir_foreach_function(function, shader)
if (function->impl)
progress = remove_phis_impl(function->impl) || progress;
diff --git a/src/compiler/nir/nir_opt_undef.c b/src/compiler/nir/nir_opt_undef.c
index f4c41c19c06..14459ff62af 100644
--- a/src/compiler/nir/nir_opt_undef.c
+++ b/src/compiler/nir/nir_opt_undef.c
@@ -76,7 +76,7 @@ nir_opt_undef(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl) {
nir_foreach_block(block, function->impl) {
nir_foreach_instr_safe(instr, block) {
diff --git a/src/compiler/nir/nir_remove_dead_variables.c b/src/compiler/nir/nir_remove_dead_variables.c
index 1f3561d8a14..f7429eb83da 100644
--- a/src/compiler/nir/nir_remove_dead_variables.c
+++ b/src/compiler/nir/nir_remove_dead_variables.c
@@ -68,7 +68,7 @@ add_var_use_tex(nir_tex_instr *instr, struct set *live)
static void
add_var_use_shader(nir_shader *shader, struct set *live)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl) {
nir_foreach_block(block, function->impl) {
nir_foreach_instr(instr, block) {
@@ -136,7 +136,7 @@ nir_remove_dead_variables(nir_shader *shader, nir_variable_mode modes)
progress = remove_dead_vars(&shader->system_values, live) || progress;
if (modes & nir_var_local) {
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl) {
if (remove_dead_vars(&function->impl->locals, live)) {
nir_metadata_preserve(function->impl, nir_metadata_block_index |
diff --git a/src/compiler/nir/nir_repair_ssa.c b/src/compiler/nir/nir_repair_ssa.c
index 7dd4065e427..7dd23979fcd 100644
--- a/src/compiler/nir/nir_repair_ssa.c
+++ b/src/compiler/nir/nir_repair_ssa.c
@@ -143,7 +143,7 @@ nir_repair_ssa(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress = nir_repair_ssa_impl(function->impl) || progress;
}
diff --git a/src/compiler/nir/nir_split_var_copies.c b/src/compiler/nir/nir_split_var_copies.c
index 8ac65bf0008..f9ad49a7cb3 100644
--- a/src/compiler/nir/nir_split_var_copies.c
+++ b/src/compiler/nir/nir_split_var_copies.c
@@ -278,7 +278,7 @@ nir_split_var_copies(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress = split_var_copies_impl(function->impl) || progress;
}
diff --git a/src/compiler/nir/nir_to_ssa.c b/src/compiler/nir/nir_to_ssa.c
index 7dc283d045b..9ffb2fdfd26 100644
--- a/src/compiler/nir/nir_to_ssa.c
+++ b/src/compiler/nir/nir_to_ssa.c
@@ -533,7 +533,7 @@ nir_convert_to_ssa_impl(nir_function_impl *impl)
void
nir_convert_to_ssa(nir_shader *shader)
{
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
nir_convert_to_ssa_impl(function->impl);
}