summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
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/gallium/drivers
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/gallium/drivers')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c2
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_nir_lower_if_else.c2
-rw-r--r--src/gallium/drivers/vc4/vc4_nir_lower_blend.c2
-rw-r--r--src/gallium/drivers/vc4/vc4_nir_lower_io.c2
-rw-r--r--src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c2
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c4
6 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
index 9bac664f7a5..6b7bb9f1dfc 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
@@ -2157,7 +2157,7 @@ emit_instructions(struct ir3_compile *ctx)
nir_function_impl *fxn = NULL;
/* Find the main function: */
- nir_foreach_function(ctx->s, function) {
+ nir_foreach_function(function, ctx->s) {
compile_assert(ctx, strcmp(function->name, "main") == 0);
compile_assert(ctx, function->impl);
fxn = function->impl;
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_nir_lower_if_else.c b/src/gallium/drivers/freedreno/ir3/ir3_nir_lower_if_else.c
index f8a1a57d0fa..f24a58da12f 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_nir_lower_if_else.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_nir_lower_if_else.c
@@ -328,7 +328,7 @@ ir3_nir_lower_if_else(nir_shader *shader)
{
bool progress = false;
- nir_foreach_function(shader, function) {
+ nir_foreach_function(function, shader) {
if (function->impl)
progress |= lower_if_else_impl(function->impl);
}
diff --git a/src/gallium/drivers/vc4/vc4_nir_lower_blend.c b/src/gallium/drivers/vc4/vc4_nir_lower_blend.c
index 05bac1e311f..c61612213e7 100644
--- a/src/gallium/drivers/vc4/vc4_nir_lower_blend.c
+++ b/src/gallium/drivers/vc4/vc4_nir_lower_blend.c
@@ -712,7 +712,7 @@ vc4_nir_lower_blend_block(nir_block *block, void *state)
void
vc4_nir_lower_blend(nir_shader *s, struct vc4_compile *c)
{
- nir_foreach_function(s, function) {
+ nir_foreach_function(function, s) {
if (function->impl) {
nir_foreach_block_call(function->impl,
vc4_nir_lower_blend_block, c);
diff --git a/src/gallium/drivers/vc4/vc4_nir_lower_io.c b/src/gallium/drivers/vc4/vc4_nir_lower_io.c
index 6f8e162fdd3..3598268cd98 100644
--- a/src/gallium/drivers/vc4/vc4_nir_lower_io.c
+++ b/src/gallium/drivers/vc4/vc4_nir_lower_io.c
@@ -457,7 +457,7 @@ vc4_nir_lower_io_impl(struct vc4_compile *c, nir_function_impl *impl)
void
vc4_nir_lower_io(nir_shader *s, struct vc4_compile *c)
{
- nir_foreach_function(s, function) {
+ nir_foreach_function(function, s) {
if (function->impl)
vc4_nir_lower_io_impl(c, function->impl);
}
diff --git a/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c b/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c
index 8069ca95f3f..958a06af8dc 100644
--- a/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c
+++ b/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c
@@ -164,7 +164,7 @@ vc4_nir_lower_txf_ms_impl(struct vc4_compile *c, nir_function_impl *impl)
void
vc4_nir_lower_txf_ms(nir_shader *s, struct vc4_compile *c)
{
- nir_foreach_function(s, function) {
+ nir_foreach_function(function, s) {
if (function->impl)
vc4_nir_lower_txf_ms_impl(c, function->impl);
}
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 58e78b8ed76..b1c8b009ffc 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -1759,7 +1759,7 @@ nir_to_qir(struct vc4_compile *c)
ntq_setup_registers(c, &c->s->registers);
/* Find the main function and emit the body. */
- nir_foreach_function(c->s, function) {
+ nir_foreach_function(function, c->s) {
assert(strcmp(function->name, "main") == 0);
assert(function->impl);
ntq_emit_impl(c, function->impl);
@@ -1791,7 +1791,7 @@ static int
count_nir_instrs(nir_shader *nir)
{
int count = 0;
- nir_foreach_function(nir, function) {
+ nir_foreach_function(function, nir) {
if (!function->impl)
continue;
nir_foreach_block_call(function->impl, count_nir_instrs_in_block, &count);