summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2018-10-20 18:00:09 +0100
committerEric Engestrom <[email protected]>2018-10-25 12:43:18 +0100
commite27902a261361e8a7980db14138ef13753db196d (patch)
tree021b6638314baf37073766f1092e2be736da75aa /src/compiler/nir
parentbb84fa146f2252f22999205a2904d8a948bffd3b (diff)
util: use C99 declaration in the for-loop set_foreach() macro
Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_control_flow.c1
-rw-r--r--src/compiler/nir/nir_dominance.c4
-rw-r--r--src/compiler/nir/nir_from_ssa.c1
-rw-r--r--src/compiler/nir/nir_gs_count_vertices.c1
-rw-r--r--src/compiler/nir/nir_liveness.c1
-rw-r--r--src/compiler/nir/nir_lower_gs_intrinsics.c1
-rw-r--r--src/compiler/nir/nir_lower_io_to_temporaries.c1
-rw-r--r--src/compiler/nir/nir_lower_vars_to_ssa.c2
-rw-r--r--src/compiler/nir/nir_opt_if.c1
-rw-r--r--src/compiler/nir/nir_phi_builder.c2
-rw-r--r--src/compiler/nir/nir_print.c1
-rw-r--r--src/compiler/nir/nir_split_vars.c1
-rw-r--r--src/compiler/nir/nir_to_lcssa.c1
13 files changed, 0 insertions, 18 deletions
diff --git a/src/compiler/nir/nir_control_flow.c b/src/compiler/nir/nir_control_flow.c
index 92e92c5dea1..ddba2e55b45 100644
--- a/src/compiler/nir/nir_control_flow.c
+++ b/src/compiler/nir/nir_control_flow.c
@@ -189,7 +189,6 @@ split_block_beginning(nir_block *block)
new_block->cf_node.parent = block->cf_node.parent;
exec_node_insert_node_before(&block->cf_node.node, &new_block->cf_node.node);
- struct set_entry *entry;
set_foreach(block->predecessors, entry) {
nir_block *pred = (nir_block *) entry->key;
replace_successor(pred, block, new_block);
diff --git a/src/compiler/nir/nir_dominance.c b/src/compiler/nir/nir_dominance.c
index 1781cdcc6f4..c678727b471 100644
--- a/src/compiler/nir/nir_dominance.c
+++ b/src/compiler/nir/nir_dominance.c
@@ -42,7 +42,6 @@ init_block(nir_block *block, nir_function_impl *impl)
block->imm_dom = NULL;
block->num_dom_children = 0;
- struct set_entry *entry;
set_foreach(block->dom_frontier, entry) {
_mesa_set_remove(block->dom_frontier, entry);
}
@@ -72,7 +71,6 @@ static bool
calc_dominance(nir_block *block)
{
nir_block *new_idom = NULL;
- struct set_entry *entry;
set_foreach(block->predecessors, entry) {
nir_block *pred = (nir_block *) entry->key;
@@ -96,7 +94,6 @@ static bool
calc_dom_frontier(nir_block *block)
{
if (block->predecessors->entries > 1) {
- struct set_entry *entry;
set_foreach(block->predecessors, entry) {
nir_block *runner = (nir_block *) entry->key;
@@ -269,7 +266,6 @@ nir_dump_dom_frontier_impl(nir_function_impl *impl, FILE *fp)
{
nir_foreach_block(block, impl) {
fprintf(fp, "DF(%u) = {", block->index);
- struct set_entry *entry;
set_foreach(block->dom_frontier, entry) {
nir_block *df = (nir_block *) entry->key;
fprintf(fp, "%u, ", df->index);
diff --git a/src/compiler/nir/nir_from_ssa.c b/src/compiler/nir/nir_from_ssa.c
index 08d480f119c..e13c510c111 100644
--- a/src/compiler/nir/nir_from_ssa.c
+++ b/src/compiler/nir/nir_from_ssa.c
@@ -830,7 +830,6 @@ place_phi_read(nir_shader *shader, nir_register *reg,
if (block != def->parent_instr->block) {
/* Try to go up the single-successor tree */
bool all_single_successors = true;
- struct set_entry *entry;
set_foreach(block->predecessors, entry) {
nir_block *pred = (nir_block *)entry->key;
if (pred->successors[0] && pred->successors[1]) {
diff --git a/src/compiler/nir/nir_gs_count_vertices.c b/src/compiler/nir/nir_gs_count_vertices.c
index 934c46b78f1..06b9cdf7376 100644
--- a/src/compiler/nir/nir_gs_count_vertices.c
+++ b/src/compiler/nir/nir_gs_count_vertices.c
@@ -62,7 +62,6 @@ nir_gs_count_vertices(const nir_shader *shader)
/* set_vertex_count intrinsics only appear in predecessors of the
* end block. So we don't need to walk all of them.
*/
- struct set_entry *entry;
set_foreach(function->impl->end_block->predecessors, entry) {
nir_block *block = (nir_block *) entry->key;
diff --git a/src/compiler/nir/nir_liveness.c b/src/compiler/nir/nir_liveness.c
index 1fcb01d5ef6..03e252fbfd8 100644
--- a/src/compiler/nir/nir_liveness.c
+++ b/src/compiler/nir/nir_liveness.c
@@ -218,7 +218,6 @@ nir_live_ssa_defs_impl(nir_function_impl *impl)
* changed, add the predecessor to the work list so that we ensure
* that the new information is used.
*/
- struct set_entry *entry;
set_foreach(block->predecessors, entry) {
nir_block *pred = (nir_block *)entry->key;
if (propagate_across_edge(pred, block, &state))
diff --git a/src/compiler/nir/nir_lower_gs_intrinsics.c b/src/compiler/nir/nir_lower_gs_intrinsics.c
index 4ddace9cf6a..78c12e05475 100644
--- a/src/compiler/nir/nir_lower_gs_intrinsics.c
+++ b/src/compiler/nir/nir_lower_gs_intrinsics.c
@@ -165,7 +165,6 @@ append_set_vertex_count(nir_block *end_block, struct state *state)
/* Insert the new intrinsic in all of the predecessors of the end block,
* but before any jump instructions (return).
*/
- struct set_entry *entry;
set_foreach(end_block->predecessors, entry) {
nir_block *pred = (nir_block *) entry->key;
b->cursor = nir_after_block_before_jump(pred);
diff --git a/src/compiler/nir/nir_lower_io_to_temporaries.c b/src/compiler/nir/nir_lower_io_to_temporaries.c
index d93e20e8d75..b83aaf46e6a 100644
--- a/src/compiler/nir/nir_lower_io_to_temporaries.c
+++ b/src/compiler/nir/nir_lower_io_to_temporaries.c
@@ -98,7 +98,6 @@ emit_output_copies_impl(struct lower_io_state *state, nir_function_impl *impl)
/* For all other shader types, we need to do the copies right before
* the jumps to the end block.
*/
- struct set_entry *block_entry;
set_foreach(impl->end_block->predecessors, block_entry) {
struct nir_block *block = (void *)block_entry->key;
b.cursor = nir_after_block_before_jump(block);
diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c b/src/compiler/nir/nir_lower_vars_to_ssa.c
index b3f29e07b63..8e517a78957 100644
--- a/src/compiler/nir/nir_lower_vars_to_ssa.c
+++ b/src/compiler/nir/nir_lower_vars_to_ssa.c
@@ -460,7 +460,6 @@ lower_copies_to_load_store(struct deref_node *node,
nir_builder b;
nir_builder_init(&b, state->impl);
- struct set_entry *copy_entry;
set_foreach(node->copies, copy_entry) {
nir_intrinsic_instr *copy = (void *)copy_entry->key;
@@ -727,7 +726,6 @@ nir_lower_vars_to_ssa_impl(nir_function_impl *impl)
assert(node->path.path[0]->var->constant_initializer == NULL);
if (node->stores) {
- struct set_entry *store_entry;
set_foreach(node->stores, store_entry) {
nir_intrinsic_instr *store =
(nir_intrinsic_instr *)store_entry->key;
diff --git a/src/compiler/nir/nir_opt_if.c b/src/compiler/nir/nir_opt_if.c
index 0c94aa170b5..fb161f1c4fd 100644
--- a/src/compiler/nir/nir_opt_if.c
+++ b/src/compiler/nir/nir_opt_if.c
@@ -40,7 +40,6 @@ find_continue_block(nir_loop *loop)
assert(header_block->predecessors->entries == 2);
- struct set_entry *pred_entry;
set_foreach(header_block->predecessors, pred_entry) {
if (pred_entry->key != prev_block)
return (nir_block*)pred_entry->key;
diff --git a/src/compiler/nir/nir_phi_builder.c b/src/compiler/nir/nir_phi_builder.c
index 883884bb7f5..cc5ce81d120 100644
--- a/src/compiler/nir/nir_phi_builder.c
+++ b/src/compiler/nir/nir_phi_builder.c
@@ -129,7 +129,6 @@ nir_phi_builder_add_value(struct nir_phi_builder *pb, unsigned num_components,
while (w_start != w_end) {
nir_block *cur = pb->W[w_start++];
- struct set_entry *dom_entry;
set_foreach(cur->dom_frontier, dom_entry) {
nir_block *next = (nir_block *) dom_entry->key;
@@ -276,7 +275,6 @@ nir_phi_builder_finish(struct nir_phi_builder *pb)
* XXX: Calling qsort this many times seems expensive.
*/
int num_preds = 0;
- struct set_entry *entry;
set_foreach(phi->instr.block->predecessors, entry)
preds[num_preds++] = (nir_block *)entry->key;
qsort(preds, num_preds, sizeof(*preds), compare_blocks);
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index 19f26f46405..ab3d5115688 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -1085,7 +1085,6 @@ print_block(nir_block *block, print_state *state, unsigned tabs)
nir_block **preds =
malloc(block->predecessors->entries * sizeof(nir_block *));
- struct set_entry *entry;
unsigned i = 0;
set_foreach(block->predecessors, entry) {
preds[i++] = (nir_block *) entry->key;
diff --git a/src/compiler/nir/nir_split_vars.c b/src/compiler/nir/nir_split_vars.c
index 7eda99819cc..bf9205c5150 100644
--- a/src/compiler/nir/nir_split_vars.c
+++ b/src/compiler/nir/nir_split_vars.c
@@ -1200,7 +1200,6 @@ shrink_vec_var_list(struct exec_list *vars,
if (!var_usage || !var_usage->vars_copied)
continue;
- struct set_entry *copy_entry;
set_foreach(var_usage->vars_copied, copy_entry) {
struct vec_var_usage *copy_usage = (void *)copy_entry->key;
if (copy_usage->comps_kept != var_usage->comps_kept) {
diff --git a/src/compiler/nir/nir_to_lcssa.c b/src/compiler/nir/nir_to_lcssa.c
index 0f62fc39400..7948b117927 100644
--- a/src/compiler/nir/nir_to_lcssa.c
+++ b/src/compiler/nir/nir_to_lcssa.c
@@ -122,7 +122,6 @@ convert_loop_exit_for_ssa(nir_ssa_def *def, void *void_state)
/* Create a phi node with as many sources pointing to the same ssa_def as
* the block has predecessors.
*/
- struct set_entry *entry;
set_foreach(block_after_loop->predecessors, entry) {
nir_phi_src *phi_src = ralloc(phi, nir_phi_src);
phi_src->src = nir_src_for_ssa(def);