aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-04-26 18:34:19 -0700
committerJason Ekstrand <[email protected]>2016-04-28 15:54:48 -0700
commit707e72f13bb78869ee95d3286980bf1709cba6cf (patch)
tree351ee47ca2ac2b54fb7ef0e8effa65a6e81b2c80 /src/mesa/drivers
parent261d62de33b6192ec31f034a9897d034a37fa582 (diff)
nir: Switch the arguments to nir_foreach_instr
This matches the "foreach x in container" pattern found in many other programming languages. Generated by the following regular expression: s/nir_foreach_instr(\([^,]*\),\s*\([^,]*\))/nir_foreach_instr(\2, \1)/ and similar expressions for nir_foreach_instr_safe etc. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_nir.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir.c8
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir_analyze_boolean_resolves.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir_attribute_workarounds.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir_opt_peephole_ffma.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_nir.cpp4
6 files changed, 11 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index fcc8ee6e8f2..365d21000dc 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -185,7 +185,7 @@ emit_system_values_block(nir_block *block, fs_visitor *v)
{
fs_reg *reg;
- nir_foreach_instr(block, instr) {
+ nir_foreach_instr(instr, block) {
if (instr->type != nir_instr_type_intrinsic)
continue;
@@ -432,7 +432,7 @@ fs_visitor::nir_emit_loop(nir_loop *loop)
void
fs_visitor::nir_emit_block(nir_block *block)
{
- nir_foreach_instr(block, instr) {
+ nir_foreach_instr(instr, block) {
nir_emit_instr(instr);
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index 3dd5f0785cf..7ee2a8f79a8 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -59,7 +59,7 @@ static bool
add_const_offset_to_base_block(nir_block *block, nir_builder *b,
nir_variable_mode mode)
{
- nir_foreach_instr_safe(block, instr) {
+ nir_foreach_instr_safe(instr, block) {
if (instr->type != nir_instr_type_intrinsic)
continue;
@@ -98,7 +98,7 @@ add_const_offset_to_base(nir_shader *nir, nir_variable_mode mode)
static bool
remap_vs_attrs(nir_block *block, GLbitfield64 inputs_read)
{
- nir_foreach_instr(block, instr) {
+ nir_foreach_instr(instr, block) {
if (instr->type != nir_instr_type_intrinsic)
continue;
@@ -122,7 +122,7 @@ remap_vs_attrs(nir_block *block, GLbitfield64 inputs_read)
static bool
remap_inputs_with_vue_map(nir_block *block, const struct brw_vue_map *vue_map)
{
- nir_foreach_instr(block, instr) {
+ nir_foreach_instr(instr, block) {
if (instr->type != nir_instr_type_intrinsic)
continue;
@@ -142,7 +142,7 @@ static bool
remap_patch_urb_offsets(nir_block *block, nir_builder *b,
const struct brw_vue_map *vue_map)
{
- nir_foreach_instr_safe(block, instr) {
+ nir_foreach_instr_safe(instr, block) {
if (instr->type != nir_instr_type_intrinsic)
continue;
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 e09329fc0d4..16eaacd0bec 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
@@ -86,7 +86,7 @@ src_mark_needs_resolve(nir_src *src, void *void_state)
static bool
analyze_boolean_resolves_block(nir_block *block)
{
- nir_foreach_instr(block, instr) {
+ nir_foreach_instr(instr, block) {
switch (instr->type) {
case nir_instr_type_alu: {
/* For ALU instructions, the resolve status is handled in a
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 c21e16d6508..93beab4d601 100644
--- a/src/mesa/drivers/dri/i965/brw_nir_attribute_workarounds.c
+++ b/src/mesa/drivers/dri/i965/brw_nir_attribute_workarounds.c
@@ -43,7 +43,7 @@ apply_attr_wa_block(nir_block *block, struct attr_wa_state *state)
{
nir_builder *b = &state->builder;
- nir_foreach_instr_safe(block, instr) {
+ nir_foreach_instr_safe(instr, block) {
if (instr->type != nir_instr_type_intrinsic)
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 b571bb9b8d3..acc9e80ee16 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
@@ -171,7 +171,7 @@ brw_nir_opt_peephole_ffma_block(nir_block *block, void *mem_ctx)
{
bool progress = false;
- nir_foreach_instr_safe(block, instr) {
+ nir_foreach_instr_safe(instr, block) {
if (instr->type != nir_instr_type_alu)
continue;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index 2694905cb7e..c988942ff3d 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -100,7 +100,7 @@ vec4_visitor::nir_setup_system_value_intrinsic(nir_intrinsic_instr *instr)
static bool
setup_system_values_block(nir_block *block, vec4_visitor *v)
{
- nir_foreach_instr(block, instr) {
+ nir_foreach_instr(instr, block) {
if (instr->type != nir_instr_type_intrinsic)
continue;
@@ -213,7 +213,7 @@ vec4_visitor::nir_emit_loop(nir_loop *loop)
void
vec4_visitor::nir_emit_block(nir_block *block)
{
- nir_foreach_instr(block, instr) {
+ nir_foreach_instr(instr, block) {
nir_emit_instr(instr);
}
}