From c6a16f6d0e489e6d2a1a75bcf34be00e892b3120 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 24 Jun 2014 21:58:35 -0700 Subject: glsl: Use typed foreach_in_list_safe instead of foreach_list_safe. Reviewed-by: Ian Romanick --- src/glsl/opt_dead_code_local.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/glsl/opt_dead_code_local.cpp') diff --git a/src/glsl/opt_dead_code_local.cpp b/src/glsl/opt_dead_code_local.cpp index d9bc5ed7c1b..4770fcff2ea 100644 --- a/src/glsl/opt_dead_code_local.cpp +++ b/src/glsl/opt_dead_code_local.cpp @@ -70,9 +70,7 @@ public: void use_channels(ir_variable *const var, int used) { - foreach_list_safe(n, this->assignments) { - assignment_entry *entry = (assignment_entry *) n; - + foreach_in_list_safe(assignment_entry, entry, this->assignments) { if (entry->lhs == var) { if (var->type->is_scalar() || var->type->is_vector()) { if (debug) @@ -119,8 +117,7 @@ public: /* For the purpose of dead code elimination, emitting a vertex counts as * "reading" all of the currently assigned output variables. */ - foreach_list_safe(n, this->assignments) { - assignment_entry *entry = (assignment_entry *) n; + foreach_in_list_safe(assignment_entry, entry, this->assignments) { if (entry->lhs->data.mode == ir_var_shader_out) { if (debug) printf("kill %s\n", entry->lhs->name); @@ -196,9 +193,7 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments) printf("looking for %s.0x%01x to remove\n", var->name, ir->write_mask); - foreach_list_safe(n, assignments) { - assignment_entry *entry = (assignment_entry *) n; - + foreach_in_list_safe(assignment_entry, entry, assignments) { if (entry->lhs != var) continue; @@ -258,9 +253,7 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments) */ if (debug) printf("looking for %s to remove\n", var->name); - foreach_list_safe(n, assignments) { - assignment_entry *entry = (assignment_entry *) n; - + foreach_in_list_safe(assignment_entry, entry, assignments) { if (entry->lhs == var) { if (debug) printf("removing %s\n", var->name); -- cgit v1.2.3