diff options
author | Jason Ekstrand <[email protected]> | 2016-04-26 20:26:42 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-04-28 15:54:48 -0700 |
commit | 9464d8c49813aba77285e7465b96e92a91ed327c (patch) | |
tree | e39fa6395b6e5fd1eba81fb1520cf047c91cd5f2 /src/mesa/drivers | |
parent | e63766fb4b54bc88756ee7e82c3ff8cec0dc5561 (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/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_nir.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_nir_analyze_boolean_resolves.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_nir_attribute_workarounds.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 4 |
6 files changed, 13 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 365d21000dc..360e2c97d74 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -42,7 +42,7 @@ fs_visitor::emit_nir_code() nir_emit_system_values(); /* get the main function and emit it */ - nir_foreach_function(nir, function) { + nir_foreach_function(function, nir) { assert(strcmp(function->name, "main") == 0); assert(function->impl); nir_emit_impl(function->impl); @@ -344,7 +344,7 @@ fs_visitor::nir_emit_system_values() nir_system_values[i] = fs_reg(); } - nir_foreach_function(nir, function) { + nir_foreach_function(function, nir) { assert(strcmp(function->name, "main") == 0); assert(function->impl); nir_foreach_block(block, function->impl) { diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c index 7ee2a8f79a8..5475276d9cf 100644 --- a/src/mesa/drivers/dri/i965/brw_nir.c +++ b/src/mesa/drivers/dri/i965/brw_nir.c @@ -84,7 +84,7 @@ add_const_offset_to_base_block(nir_block *block, nir_builder *b, static void add_const_offset_to_base(nir_shader *nir, nir_variable_mode mode) { - nir_foreach_function(nir, f) { + nir_foreach_function(f, nir) { if (f->impl) { nir_builder b; nir_builder_init(&b, f->impl); @@ -222,7 +222,7 @@ brw_nir_lower_vs_inputs(nir_shader *nir, */ GLbitfield64 inputs_read = nir->info.inputs_read; - nir_foreach_function(nir, function) { + nir_foreach_function(function, nir) { if (function->impl) { nir_foreach_block(block, function->impl) { remap_vs_attrs(block, inputs_read); @@ -249,7 +249,7 @@ brw_nir_lower_vue_inputs(nir_shader *nir, bool is_scalar, add_const_offset_to_base(nir, nir_var_shader_in); - nir_foreach_function(nir, function) { + nir_foreach_function(function, nir) { if (function->impl) { nir_foreach_block(block, function->impl) { remap_inputs_with_vue_map(block, vue_map); @@ -273,7 +273,7 @@ brw_nir_lower_tes_inputs(nir_shader *nir, const struct brw_vue_map *vue_map) add_const_offset_to_base(nir, nir_var_shader_in); - nir_foreach_function(nir, function) { + nir_foreach_function(function, nir) { if (function->impl) { nir_builder b; nir_builder_init(&b, function->impl); @@ -320,7 +320,7 @@ brw_nir_lower_tcs_outputs(nir_shader *nir, const struct brw_vue_map *vue_map) add_const_offset_to_base(nir, nir_var_shader_out); - nir_foreach_function(nir, function) { + nir_foreach_function(function, nir) { if (function->impl) { nir_builder b; nir_builder_init(&b, function->impl); @@ -501,7 +501,7 @@ brw_postprocess_nir(nir_shader *nir, if (unlikely(debug_enabled)) { /* Re-index SSA defs so we print more sensible numbers. */ - nir_foreach_function(nir, function) { + nir_foreach_function(function, nir) { if (function->impl) nir_index_ssa_defs(function->impl); } diff --git a/src/mesa/drivers/dri/i965/brw_nir_analyze_boolean_resolves.c b/src/mesa/drivers/dri/i965/brw_nir_analyze_boolean_resolves.c index 16eaacd0bec..4ad26e21103 100644 --- a/src/mesa/drivers/dri/i965/brw_nir_analyze_boolean_resolves.c +++ b/src/mesa/drivers/dri/i965/brw_nir_analyze_boolean_resolves.c @@ -262,7 +262,7 @@ analyze_boolean_resolves_impl(nir_function_impl *impl) void brw_nir_analyze_boolean_resolves(nir_shader *shader) { - nir_foreach_function(shader, function) { + nir_foreach_function(function, shader) { if (function->impl) analyze_boolean_resolves_impl(function->impl); } diff --git a/src/mesa/drivers/dri/i965/brw_nir_attribute_workarounds.c b/src/mesa/drivers/dri/i965/brw_nir_attribute_workarounds.c index 93beab4d601..0bb766d702d 100644 --- a/src/mesa/drivers/dri/i965/brw_nir_attribute_workarounds.c +++ b/src/mesa/drivers/dri/i965/brw_nir_attribute_workarounds.c @@ -155,7 +155,7 @@ brw_nir_apply_attribute_workarounds(nir_shader *shader, .wa_flags = attrib_wa_flags, }; - nir_foreach_function(shader, func) { + nir_foreach_function(func, shader) { if (!func->impl) continue; diff --git a/src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c b/src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c index acc9e80ee16..e7df80db491 100644 --- a/src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c +++ b/src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c @@ -303,7 +303,7 @@ brw_nir_opt_peephole_ffma(nir_shader *shader) { bool progress = false; - nir_foreach_function(shader, function) { + nir_foreach_function(function, shader) { if (function->impl) progress |= brw_nir_opt_peephole_ffma_impl(function->impl); } diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp index c988942ff3d..c7dc23b365b 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp @@ -41,7 +41,7 @@ vec4_visitor::emit_nir_code() nir_setup_system_values(); /* get the main function and emit it */ - nir_foreach_function(nir, function) { + nir_foreach_function(function, nir) { assert(strcmp(function->name, "main") == 0); assert(function->impl); nir_emit_impl(function->impl); @@ -119,7 +119,7 @@ vec4_visitor::nir_setup_system_values() nir_system_values[i] = dst_reg(); } - nir_foreach_function(nir, function) { + nir_foreach_function(function, nir) { assert(strcmp(function->name, "main") == 0); assert(function->impl); nir_foreach_block(block, function->impl) { |