Commit 5f7e778f authored by Kenneth Graunke's avatar Kenneth Graunke

glsl: Convert piles of foreach_iter to the newer foreach_list macro.

foreach_iter and exec_list_iterators have been deprecated for some time now;
we just hadn't ever bothered to convert code to the newer foreach_list
and foreach_list_safe macros.

In these cases, we aren't editing the list, so we can use foreach_list
rather than foreach_list_safe.
Signed-off-by: default avatarKenneth Graunke <kenneth@whitecape.org>
Reviewed-by: default avatarMatt Turner <mattst88@gmail.com>
Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
parent fb6d9798
......@@ -3818,8 +3818,8 @@ ast_function_definition::hir(exec_list *instructions,
* Add these to the symbol table.
*/
state->symbols->push_scope();
foreach_iter(exec_list_iterator, iter, signature->parameters) {
ir_variable *const var = ((ir_instruction *) iter.get())->as_variable();
foreach_list(n, &signature->parameters) {
ir_variable *const var = ((ir_instruction *) n)->as_variable();
assert(var != NULL);
......
......@@ -2398,8 +2398,8 @@ builtin_builder::call(ir_function *f, ir_variable *ret, exec_list params)
{
exec_list actual_params;
foreach_iter(exec_list_iterator, it, params) {
ir_variable *var = ((ir_instruction *)it.get())->as_variable();
foreach_list(node, &params) {
ir_variable *var = ((ir_instruction *) node)->as_variable();
actual_params.push_tail(var_ref(var));
}
......
......@@ -1739,8 +1739,8 @@ steal_memory(ir_instruction *ir, void *new_ctx)
*/
if (constant != NULL) {
if (constant->type->is_record()) {
foreach_iter(exec_list_iterator, iter, constant->components) {
ir_constant *field = (ir_constant *)iter.get();
foreach_list(n, &constant->components) {
ir_constant *field = (ir_constant *) n;
steal_memory(field, ir);
}
} else if (constant->type->is_array()) {
......
......@@ -58,8 +58,8 @@ void call_for_basic_blocks(exec_list *instructions,
ir_instruction *leader = NULL;
ir_instruction *last = NULL;
foreach_iter(exec_list_iterator, iter, *instructions) {
ir_instruction *ir = (ir_instruction *)iter.get();
foreach_list(n, instructions) {
ir_instruction *ir = (ir_instruction *) n;
ir_if *ir_if;
ir_loop *ir_loop;
ir_function *ir_function;
......@@ -90,10 +90,8 @@ void call_for_basic_blocks(exec_list *instructions,
* and the body of main(). Perhaps those instructions ought
* to live inside of main().
*/
foreach_iter(exec_list_iterator, fun_iter, *ir_function) {
ir_function_signature *ir_sig;
ir_sig = (ir_function_signature *)fun_iter.get();
foreach_list(func_node, &ir_function->signatures) {
ir_function_signature *ir_sig = (ir_function_signature *) func_node;
call_for_basic_blocks(&ir_sig->body, callback, data);
}
......
......@@ -123,13 +123,13 @@ ir_if::clone(void *mem_ctx, struct hash_table *ht) const
{
ir_if *new_if = new(mem_ctx) ir_if(this->condition->clone(mem_ctx, ht));
foreach_iter(exec_list_iterator, iter, this->then_instructions) {
ir_instruction *ir = (ir_instruction *)iter.get();
foreach_list(n, &this->then_instructions) {
ir_instruction *ir = (ir_instruction *) n;
new_if->then_instructions.push_tail(ir->clone(mem_ctx, ht));
}
foreach_iter(exec_list_iterator, iter, this->else_instructions) {
ir_instruction *ir = (ir_instruction *)iter.get();
foreach_list(n, &this->else_instructions) {
ir_instruction *ir = (ir_instruction *) n;
new_if->else_instructions.push_tail(ir->clone(mem_ctx, ht));
}
......@@ -141,8 +141,8 @@ ir_loop::clone(void *mem_ctx, struct hash_table *ht) const
{
ir_loop *new_loop = new(mem_ctx) ir_loop();
foreach_iter(exec_list_iterator, iter, this->body_instructions) {
ir_instruction *ir = (ir_instruction *)iter.get();
foreach_list(n, &this->body_instructions) {
ir_instruction *ir = (ir_instruction *) n;
new_loop->body_instructions.push_tail(ir->clone(mem_ctx, ht));
}
......@@ -158,8 +158,8 @@ ir_call::clone(void *mem_ctx, struct hash_table *ht) const
exec_list new_parameters;
foreach_iter(exec_list_iterator, iter, this->actual_parameters) {
ir_instruction *ir = (ir_instruction *)iter.get();
foreach_list(n, &this->actual_parameters) {
ir_instruction *ir = (ir_instruction *) n;
new_parameters.push_tail(ir->clone(mem_ctx, ht));
}
......
......@@ -59,8 +59,8 @@ do_expression_flattening(exec_list *instructions,
{
ir_expression_flattening_visitor v(predicate);
foreach_iter(exec_list_iterator, iter, *instructions) {
ir_instruction *ir = (ir_instruction *)iter.get();
foreach_list(n, instructions) {
ir_instruction *ir = (ir_instruction *) n;
ir->accept(&v);
}
......
......@@ -141,9 +141,8 @@ ir_function::matching_signature(_mesa_glsl_parse_state *state,
* multiple ways to apply these conversions to the actual arguments of a
* call such that the call can be made to match multiple signatures."
*/
foreach_iter(exec_list_iterator, iter, signatures) {
ir_function_signature *const sig =
(ir_function_signature *) iter.get();
foreach_list(n, &this->signatures) {
ir_function_signature *const sig = (ir_function_signature *) n;
/* Skip over any built-ins that aren't available in this shader. */
if (sig->is_builtin() && !sig->is_builtin_available(state))
......@@ -212,9 +211,8 @@ ir_function_signature *
ir_function::exact_matching_signature(_mesa_glsl_parse_state *state,
const exec_list *actual_parameters)
{
foreach_iter(exec_list_iterator, iter, signatures) {
ir_function_signature *const sig =
(ir_function_signature *) iter.get();
foreach_list(n, &this->signatures) {
ir_function_signature *const sig = (ir_function_signature *) n;
/* Skip over any built-ins that aren't available in this shader. */
if (sig->is_builtin() && !sig->is_builtin_available(state))
......
......@@ -61,8 +61,8 @@ _mesa_print_ir(exec_list *instructions,
}
printf("(\n");
foreach_iter(exec_list_iterator, iter, *instructions) {
ir_instruction *ir = (ir_instruction *)iter.get();
foreach_list(n, instructions) {
ir_instruction *ir = (ir_instruction *) n;
ir->print();
if (ir->ir_type != ir_type_function)
printf("\n");
......@@ -179,8 +179,8 @@ void ir_print_visitor::visit(ir_function_signature *ir)
printf("(parameters\n");
indentation++;
foreach_iter(exec_list_iterator, iter, ir->parameters) {
ir_variable *const inst = (ir_variable *) iter.get();
foreach_list(n, &ir->parameters) {
ir_variable *const inst = (ir_variable *) n;
indent();
inst->accept(this);
......@@ -196,8 +196,8 @@ void ir_print_visitor::visit(ir_function_signature *ir)
printf("(\n");
indentation++;
foreach_iter(exec_list_iterator, iter, ir->body) {
ir_instruction *const inst = (ir_instruction *) iter.get();
foreach_list(n, &ir->body) {
ir_instruction *const inst = (ir_instruction *) n;
indent();
inst->accept(this);
......@@ -215,8 +215,8 @@ void ir_print_visitor::visit(ir_function *ir)
{
printf("(function %s\n", ir->name);
indentation++;
foreach_iter(exec_list_iterator, iter, *ir) {
ir_function_signature *const sig = (ir_function_signature *) iter.get();
foreach_list(n, &ir->signatures) {
ir_function_signature *const sig = (ir_function_signature *) n;
indent();
sig->accept(this);
printf("\n");
......@@ -440,8 +440,8 @@ ir_print_visitor::visit(ir_call *ir)
if (ir->return_deref)
ir->return_deref->accept(this);
printf(" (");
foreach_iter(exec_list_iterator, iter, *ir) {
ir_instruction *const inst = (ir_instruction *) iter.get();
foreach_list(n, &ir->actual_parameters) {
ir_instruction *const inst = (ir_instruction *) n;
inst->accept(this);
}
......@@ -487,8 +487,8 @@ ir_print_visitor::visit(ir_if *ir)
printf("(\n");
indentation++;
foreach_iter(exec_list_iterator, iter, ir->then_instructions) {
ir_instruction *const inst = (ir_instruction *) iter.get();
foreach_list(n, &ir->then_instructions) {
ir_instruction *const inst = (ir_instruction *) n;
indent();
inst->accept(this);
......@@ -504,8 +504,8 @@ ir_print_visitor::visit(ir_if *ir)
printf("(\n");
indentation++;
foreach_iter(exec_list_iterator, iter, ir->else_instructions) {
ir_instruction *const inst = (ir_instruction *) iter.get();
foreach_list(n, &ir->else_instructions) {
ir_instruction *const inst = (ir_instruction *) n;
indent();
inst->accept(this);
......@@ -526,8 +526,8 @@ ir_print_visitor::visit(ir_loop *ir)
printf("(loop (\n");
indentation++;
foreach_iter(exec_list_iterator, iter, ir->body_instructions) {
ir_instruction *const inst = (ir_instruction *) iter.get();
foreach_list(n, &ir->body_instructions) {
ir_instruction *const inst = (ir_instruction *) n;
indent();
inst->accept(this);
......
......@@ -170,8 +170,8 @@ ir_reader::scan_for_prototypes(exec_list *instructions, s_expression *expr)
return;
}
foreach_iter(exec_list_iterator, it, list->subexpressions) {
s_list *sub = SX_AS_LIST(it.get());
foreach_list(n, &list->subexpressions) {
s_list *sub = SX_AS_LIST(n);
if (sub == NULL)
continue; // not a (function ...); ignore it.
......@@ -315,8 +315,8 @@ ir_reader::read_instructions(exec_list *instructions, s_expression *expr,
return;
}
foreach_iter(exec_list_iterator, it, list->subexpressions) {
s_expression *sub = (s_expression*) it.get();
foreach_list(n, &list->subexpressions) {
s_expression *sub = (s_expression *) n;
ir_instruction *ir = read_instruction(sub, loop_ctx);
if (ir != NULL) {
/* Global variable declarations should be moved to the top, before
......@@ -403,8 +403,8 @@ ir_reader::read_declaration(s_expression *expr)
ir_variable *var = new(mem_ctx) ir_variable(type, s_name->value(),
ir_var_auto);
foreach_iter(exec_list_iterator, it, s_quals->subexpressions) {
s_symbol *qualifier = SX_AS_SYMBOL(it.get());
foreach_list(n, &s_quals->subexpressions) {
s_symbol *qualifier = SX_AS_SYMBOL(n);
if (qualifier == NULL) {
ir_read_error(expr, "qualifier list must contain only symbols");
return NULL;
......@@ -656,8 +656,8 @@ ir_reader::read_call(s_expression *expr)
exec_list parameters;
foreach_iter(exec_list_iterator, it, params->subexpressions) {
s_expression *expr = (s_expression*) it.get();
foreach_list(n, &params->subexpressions) {
s_expression *expr = (s_expression *) n;
ir_rvalue *param = read_rvalue(expr);
if (param == NULL) {
ir_read_error(expr, "when reading parameter to function call");
......@@ -796,8 +796,8 @@ ir_reader::read_constant(s_expression *expr)
if (type->is_array()) {
unsigned elements_supplied = 0;
exec_list elements;
foreach_iter(exec_list_iterator, it, values->subexpressions) {
s_expression *elt = (s_expression *) it.get();
foreach_list(n, &values->subexpressions) {
s_expression *elt = (s_expression *) n;
ir_constant *ir_elt = read_constant(elt);
if (ir_elt == NULL)
return NULL;
......@@ -817,13 +817,13 @@ ir_reader::read_constant(s_expression *expr)
// Read in list of values (at most 16).
unsigned k = 0;
foreach_iter(exec_list_iterator, it, values->subexpressions) {
foreach_list(n, &values->subexpressions) {
if (k >= 16) {
ir_read_error(values, "expected at most 16 numbers");
return NULL;
}
s_expression *expr = (s_expression*) it.get();
s_expression *expr = (s_expression *) n;
if (type->base_type == GLSL_TYPE_FLOAT) {
s_number *value = SX_AS_NUMBER(expr);
......
......@@ -813,8 +813,8 @@ validate_ir_tree(exec_list *instructions)
v.run(instructions);
foreach_iter(exec_list_iterator, iter, *instructions) {
ir_instruction *ir = (ir_instruction *)iter.get();
foreach_list(n, instructions) {
ir_instruction *ir = (ir_instruction *) n;
visit_tree(ir, check_node_type, NULL);
}
......
......@@ -1338,9 +1338,8 @@ link_intrastage_shaders(void *mem_ctx,
if (other == NULL)
continue;
foreach_iter (exec_list_iterator, iter, *f) {
ir_function_signature *sig =
(ir_function_signature *) iter.get();
foreach_list(n, &f->signatures) {
ir_function_signature *sig = (ir_function_signature *) n;
if (!sig->is_defined || sig->is_builtin())
continue;
......@@ -1453,8 +1452,8 @@ link_intrastage_shaders(void *mem_ctx,
if (linked->Stage == MESA_SHADER_GEOMETRY) {
unsigned num_vertices = vertices_per_prim(prog->Geom.InputType);
geom_array_resize_visitor input_resize_visitor(num_vertices, prog);
foreach_iter(exec_list_iterator, iter, *linked->ir) {
ir_instruction *ir = (ir_instruction *)iter.get();
foreach_list(n, linked->ir) {
ir_instruction *ir = (ir_instruction *) n;
ir->accept(&input_resize_visitor);
}
}
......
......@@ -178,12 +178,12 @@ ir_if_to_cond_assign_visitor::visit_leave(ir_if *ir)
ir_assignment *assign;
/* Check that both blocks don't contain anything we can't support. */
foreach_iter(exec_list_iterator, then_iter, ir->then_instructions) {
ir_instruction *then_ir = (ir_instruction *)then_iter.get();
foreach_list(n, &ir->then_instructions) {
ir_instruction *then_ir = (ir_instruction *) n;
visit_tree(then_ir, check_control_flow, &found_control_flow);
}
foreach_iter(exec_list_iterator, else_iter, ir->else_instructions) {
ir_instruction *else_ir = (ir_instruction *)else_iter.get();
foreach_list(n, &ir->else_instructions) {
ir_instruction *else_ir = (ir_instruction *) n;
visit_tree(else_ir, check_control_flow, &found_control_flow);
}
if (found_control_flow)
......
......@@ -135,8 +135,8 @@ ir_array_reference_visitor::get_variable_entry(ir_variable *var)
if (var->type->is_unsized_array())
return NULL;
foreach_iter(exec_list_iterator, iter, this->variable_list) {
variable_entry *entry = (variable_entry *)iter.get();
foreach_list(n, &this->variable_list) {
variable_entry *entry = (variable_entry *) n;
if (entry->var == var)
return entry;
}
......@@ -270,8 +270,8 @@ ir_array_splitting_visitor::get_splitting_entry(ir_variable *var)
{
assert(var);
foreach_iter(exec_list_iterator, iter, *this->variable_list) {
variable_entry *entry = (variable_entry *)iter.get();
foreach_list(n, this->variable_list) {
variable_entry *entry = (variable_entry *) n;
if (entry->var == var) {
return entry;
}
......@@ -368,8 +368,8 @@ optimize_split_arrays(exec_list *instructions, bool linked)
/* Replace the decls of the arrays to be split with their split
* components.
*/
foreach_iter(exec_list_iterator, iter, refs.variable_list) {
variable_entry *entry = (variable_entry *)iter.get();
foreach_list(n, &refs.variable_list) {
variable_entry *entry = (variable_entry *) n;
const struct glsl_type *type = entry->var->type;
const struct glsl_type *subtype;
......
......@@ -172,8 +172,8 @@ ir_constant_propagation_visitor::handle_rvalue(ir_rvalue **rvalue)
channel = i;
}
foreach_iter(exec_list_iterator, iter, *this->acp) {
acp_entry *entry = (acp_entry *)iter.get();
foreach_list(n, this->acp) {
acp_entry *entry = (acp_entry *) n;
if (entry->var == deref->var && entry->write_mask & (1 << channel)) {
found = entry;
break;
......@@ -318,8 +318,8 @@ ir_constant_propagation_visitor::handle_if_block(exec_list *instructions)
this->killed_all = false;
/* Populate the initial acp with a constant of the original */
foreach_iter(exec_list_iterator, iter, *orig_acp) {
acp_entry *a = (acp_entry *)iter.get();
foreach_list(n, orig_acp) {
acp_entry *a = (acp_entry *) n;
this->acp->push_tail(new(this->mem_ctx) acp_entry(a));
}
......@@ -334,8 +334,8 @@ ir_constant_propagation_visitor::handle_if_block(exec_list *instructions)
this->acp = orig_acp;
this->killed_all = this->killed_all || orig_killed_all;
foreach_iter(exec_list_iterator, iter, *new_kills) {
kill_entry *k = (kill_entry *)iter.get();
foreach_list(n, new_kills) {
kill_entry *k = (kill_entry *) n;
kill(k->var, k->write_mask);
}
}
......@@ -379,8 +379,8 @@ ir_constant_propagation_visitor::visit_enter(ir_loop *ir)
this->acp = orig_acp;
this->killed_all = this->killed_all || orig_killed_all;
foreach_iter(exec_list_iterator, iter, *new_kills) {
kill_entry *k = (kill_entry *)iter.get();
foreach_list(n, new_kills) {
kill_entry *k = (kill_entry *) n;
kill(k->var, k->write_mask);
}
......@@ -411,8 +411,8 @@ ir_constant_propagation_visitor::kill(ir_variable *var, unsigned write_mask)
/* Add this writemask of the variable to the list of killed
* variables in this block.
*/
foreach_iter(exec_list_iterator, iter, *this->kills) {
kill_entry *entry = (kill_entry *)iter.get();
foreach_list(n, this->kills) {
kill_entry *entry = (kill_entry *) n;
if (entry->var == var) {
entry->write_mask |= write_mask;
......
......@@ -194,13 +194,12 @@ do_constant_variable_unlinked(exec_list *instructions)
{
bool progress = false;
foreach_iter(exec_list_iterator, iter, *instructions) {
ir_instruction *ir = (ir_instruction *)iter.get();
foreach_list(n, instructions) {
ir_instruction *ir = (ir_instruction *) n;
ir_function *f = ir->as_function();
if (f) {
foreach_iter(exec_list_iterator, sigiter, *f) {
ir_function_signature *sig =
(ir_function_signature *) sigiter.get();
foreach_list(signode, &f->signatures) {
ir_function_signature *sig = (ir_function_signature *) signode;
if (do_constant_variable(&sig->body))
progress = true;
}
......
......@@ -167,8 +167,8 @@ ir_copy_propagation_visitor::visit(ir_dereference_variable *ir)
ir_variable *var = ir->var;
foreach_iter(exec_list_iterator, iter, *this->acp) {
acp_entry *entry = (acp_entry *)iter.get();
foreach_list(n, this->acp) {
acp_entry *entry = (acp_entry *) n;
if (var == entry->lhs) {
ir->var = entry->rhs;
......@@ -217,8 +217,8 @@ ir_copy_propagation_visitor::handle_if_block(exec_list *instructions)
this->killed_all = false;
/* Populate the initial acp with a copy of the original */
foreach_iter(exec_list_iterator, iter, *orig_acp) {
acp_entry *a = (acp_entry *)iter.get();
foreach_list(n, orig_acp) {
acp_entry *a = (acp_entry *) n;
this->acp->push_tail(new(this->mem_ctx) acp_entry(a->lhs, a->rhs));
}
......@@ -233,8 +233,8 @@ ir_copy_propagation_visitor::handle_if_block(exec_list *instructions)
this->acp = orig_acp;
this->killed_all = this->killed_all || orig_killed_all;
foreach_iter(exec_list_iterator, iter, *new_kills) {
kill_entry *k = (kill_entry *)iter.get();
foreach_list(n, new_kills) {
kill_entry *k = (kill_entry *) n;
kill(k->var);
}
}
......@@ -277,8 +277,8 @@ ir_copy_propagation_visitor::visit_enter(ir_loop *ir)
this->acp = orig_acp;
this->killed_all = this->killed_all || orig_killed_all;
foreach_iter(exec_list_iterator, iter, *new_kills) {
kill_entry *k = (kill_entry *)iter.get();
foreach_list(n, new_kills) {
kill_entry *k = (kill_entry *) n;
kill(k->var);
}
......
......@@ -244,8 +244,8 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir)
/* Try to find ACP entries covering swizzle_chan[], hoping they're
* the same source variable.
*/
foreach_iter(exec_list_iterator, iter, *this->acp) {
acp_entry *entry = (acp_entry *)iter.get();
foreach_list(n, this->acp) {
acp_entry *entry = (acp_entry *) n;
if (var == entry->lhs) {
for (int c = 0; c < chans; c++) {
......@@ -325,8 +325,8 @@ ir_copy_propagation_elements_visitor::handle_if_block(exec_list *instructions)
this->killed_all = false;
/* Populate the initial acp with a copy of the original */
foreach_iter(exec_list_iterator, iter, *orig_acp) {
acp_entry *a = (acp_entry *)iter.get();
foreach_list(n, orig_acp) {
acp_entry *a = (acp_entry *) n;
this->acp->push_tail(new(this->mem_ctx) acp_entry(a));
}
......
......@@ -129,13 +129,12 @@ do_dead_code_unlinked(exec_list *instructions)
{
bool progress = false;
foreach_iter(exec_list_iterator, iter, *instructions) {
ir_instruction *ir = (ir_instruction *)iter.get();
foreach_list(n, instructions) {
ir_instruction *ir = (ir_instruction *) n;
ir_function *f = ir->as_function();
if (f) {
foreach_iter(exec_list_iterator, sigiter, *f) {
ir_function_signature *sig =
(ir_function_signature *) sigiter.get();
foreach_list(signode, &f->signatures) {
ir_function_signature *sig = (ir_function_signature *) signode;
/* The setting of the uniform_locations_assigned flag here is
* irrelevent. If there is a uniform declaration encountered
* inside the body of the function, something has already gone
......
......@@ -280,8 +280,8 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments)
printf("add %s\n", var->name);
printf("current entries\n");
foreach_iter(exec_list_iterator, iter, *assignments) {
assignment_entry *entry = (assignment_entry *)iter.get();
foreach_list(n, assignments) {
assignment_entry *entry = (assignment_entry *) n;
printf(" %s (0x%01x)\n", entry->lhs->name, entry->available);
}
......
......@@ -74,8 +74,8 @@ public:
signature_entry *
ir_dead_functions_visitor::get_signature_entry(ir_function_signature *sig)
{
foreach_iter(exec_list_iterator, iter, this->signature_list) {
signature_entry *entry = (signature_entry *)iter.get();
foreach_list(n, &this->signature_list) {
signature_entry *entry = (signature_entry *) n;
if (entry->signature == sig)
return entry;
}
......
......@@ -107,7 +107,7 @@ ir_call::generate_inline(ir_instruction *next_ir)
ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
num_parameters = 0;
foreach_iter(exec_list_iterator, iter_sig, this->callee->parameters)
foreach_list(n, &this->callee->parameters)
num_parameters++;
parameters = new ir_variable *[num_parameters];
......@@ -161,8 +161,8 @@ ir_call::generate_inline(ir_instruction *next_ir)
exec_list new_instructions;
/* Generate the inlined body of the function to a new list */
foreach_iter(exec_list_iterator, iter, callee->body) {
ir_instruction *ir = (ir_instruction *)iter.get();
foreach_list(n, &callee->body) {
ir_instruction *ir = (ir_instruction *) n;
ir_instruction *new_ir = ir->clone(ctx, ht);
new_instructions.push_tail(new_ir);
......
......@@ -107,8 +107,8 @@ ir_structure_reference_visitor::get_variable_entry(ir_variable *var)
|| var->data.mode == ir_var_shader_in || var->data.mode == ir_var_shader_out)
return NULL;
foreach_iter(exec_list_iterator, iter, this->variable_list) {
variable_entry *entry = (variable_entry *)iter.get();
foreach_list(n, &this->variable_list) {
variable_entry *entry = (variable_entry *) n;
if (entry->var == var)
return entry;
}
......@@ -209,8 +209,8 @@ ir_structure_splitting_visitor::get_splitting_entry(ir_variable *var)
if (!var->type->is_record())
return NULL;
foreach_iter(exec_list_iterator, iter, *this->variable_list) {
variable_entry *entry = (variable_entry *)iter.get();
foreach_list(n, this->variable_list) {
variable_entry *entry = (variable_entry *) n;
if (entry->var == var) {
return entry;
}
......
......@@ -162,8 +162,8 @@ void s_symbol::print()
void s_list::print()
{
printf("(");
foreach_iter(exec_list_iterator, it, this->subexpressions) {
s_expression *expr = (s_expression*) it.get();
foreach_list(n, &this->subexpressions) {
s_expression *expr = (s_expression *) n;
expr->print();
if (!expr->next->is_tail_sentinel())
printf(" ");
......@@ -201,11 +201,11 @@ s_match(s_expression *top, unsigned n, s_pattern *pattern, bool partial)
return false;
unsigned i = 0;
foreach_iter(exec_list_iterator, it, list->subexpressions) {
foreach_list(node, &list->subexpressions) {
if (i >= n)
return partial; /* More actual items than the pattern expected */
s_expression *expr = (s_expression *) it.get();
s_expression *expr = (s_expression *) node;
if (expr == NULL || !pattern[i].match(expr))
return false;
......
......@@ -56,8 +56,8 @@ vec4_visitor::reg_allocate_trivial()
virtual_grf_used[i] = false;
}
foreach_iter(exec_list_iterator, iter, this->instructions) {
vec4_instruction *inst = (vec4_instruction *)iter.get();
foreach_list(node, &this->instructions) {
vec4_instruction *inst = (vec4_instruction *) node;
if (inst->dst.file == GRF)
virtual_grf_used[inst->dst.reg] = true;
......@@ -78,8 +78,8 @@ vec4_visitor::reg_allocate_trivial()
}
prog_data->total_grf = next;
foreach_iter(exec_list_iterator, iter, this->instructions) {
vec4_instruction *inst = (vec4_instruction *)iter.get();
foreach_list(node, &this->instructions) {
vec4_instruction *inst = (vec4_instruction *) node;
assign(hw_reg_mapping, &inst->dst);
assign(hw_reg_mapping, &inst->src[0]);
......
......@@ -665,8 +665,8 @@ ir_to_mesa_visitor::find_variable_storage(ir_variable *var)
variable_storage *entry;
foreach_iter(exec_list_iterator, iter, this->variables) {
entry = (variable_storage *)iter.get();
foreach_list(node, &this->variables) {
entry = (variable_storage *) node;
if (entry->var == var)
return entry;
......@@ -801,8 +801,8 @@ ir_to_mesa_visitor::visit(ir_function *ir)
assert(sig);
foreach_iter(exec_list_iterator, iter, sig->body) {
ir_instruction *ir = (ir_instruction *)iter.get();
foreach_list(node, &sig->body) {
ir_instruction *ir = (ir_instruction *) node;
ir->accept(this);
}
......@@ -1868,8 +1868,8 @@ ir_to_mesa_visitor::visit(ir_constant *ir)
src_reg temp_base = get_temp(ir->type);
dst_reg temp = dst_reg(temp_base);
foreach_iter(exec_list_iterator, iter, ir->components) {