summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_dead_code_local.cpp
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-06-24 21:58:35 -0700
committerMatt Turner <[email protected]>2014-07-01 08:55:51 -0700
commitc6a16f6d0e489e6d2a1a75bcf34be00e892b3120 (patch)
tree493e9bd86b9bad457bca713372c5c48718b6eaa0 /src/glsl/opt_dead_code_local.cpp
parente0cb82d0c4ceba437c351d1e37fdb86fe5aed997 (diff)
glsl: Use typed foreach_in_list_safe instead of foreach_list_safe.
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/opt_dead_code_local.cpp')
-rw-r--r--src/glsl/opt_dead_code_local.cpp15
1 files changed, 4 insertions, 11 deletions
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);