summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_dead_code_local.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-11-22 02:10:15 -0800
committerKenneth Graunke <[email protected]>2014-01-13 11:38:19 -0800
commit838a6871bbcd8cd0493bb39b188129f7d49de47e (patch)
tree78a442fbc3ee72f5e13d2130d8aee34cfd9b97b7 /src/glsl/opt_dead_code_local.cpp
parent5f7e778fa1b1e969a1b15e3650dec49b0026ed08 (diff)
glsl: Convert piles of foreach_iter to foreach_list_safe.
In these cases, we edit the list (or at least might be), so we use the foreach_list_safe variant. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> 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.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/glsl/opt_dead_code_local.cpp b/src/glsl/opt_dead_code_local.cpp
index 66522b9c766..e7d46edbe3e 100644
--- a/src/glsl/opt_dead_code_local.cpp
+++ b/src/glsl/opt_dead_code_local.cpp
@@ -70,8 +70,8 @@ public:
void kill_channels(ir_variable *const var, int used)
{
- foreach_iter(exec_list_iterator, iter, *this->assignments) {
- assignment_entry *entry = (assignment_entry *)iter.get();
+ foreach_list_safe(n, this->assignments) {
+ assignment_entry *entry = (assignment_entry *) n;
if (entry->lhs == var) {
if (var->type->is_scalar() || var->type->is_vector()) {
@@ -119,8 +119,8 @@ public:
/* For the purpose of dead code elimination, emitting a vertex counts as
* "reading" all of the currently assigned output variables.
*/
- foreach_iter(exec_list_iterator, iter, *this->assignments) {
- assignment_entry *entry = (assignment_entry *)iter.get();
+ foreach_list_safe(n, this->assignments) {
+ assignment_entry *entry = (assignment_entry *) n;
if (entry->lhs->data.mode == ir_var_shader_out) {
if (debug)
printf("kill %s\n", entry->lhs->name);
@@ -196,8 +196,8 @@ 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_iter(exec_list_iterator, iter, *assignments) {
- assignment_entry *entry = (assignment_entry *)iter.get();
+ foreach_list_safe(n, assignments) {
+ assignment_entry *entry = (assignment_entry *) n;
if (entry->lhs != var)
continue;
@@ -258,8 +258,8 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments)
*/
if (debug)
printf("looking for %s to remove\n", var->name);
- foreach_iter(exec_list_iterator, iter, *assignments) {
- assignment_entry *entry = (assignment_entry *)iter.get();
+ foreach_list_safe(n, assignments) {
+ assignment_entry *entry = (assignment_entry *) n;
if (entry->lhs == var) {
if (debug)