aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/opt_constant_folding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/opt_constant_folding.cpp')
-rw-r--r--mesalib/src/glsl/opt_constant_folding.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/mesalib/src/glsl/opt_constant_folding.cpp b/mesalib/src/glsl/opt_constant_folding.cpp
index 08a47b96b..d0e575460 100644
--- a/mesalib/src/glsl/opt_constant_folding.cpp
+++ b/mesalib/src/glsl/opt_constant_folding.cpp
@@ -122,10 +122,10 @@ ir_visitor_status
ir_constant_folding_visitor::visit_enter(ir_call *ir)
{
/* Attempt to constant fold parameters */
- exec_list_iterator sig_iter = ir->callee->parameters.iterator();
- foreach_iter(exec_list_iterator, iter, *ir) {
- ir_rvalue *param_rval = (ir_rvalue *)iter.get();
- ir_variable *sig_param = (ir_variable *)sig_iter.get();
+ foreach_two_lists(formal_node, &ir->callee->parameters,
+ actual_node, &ir->actual_parameters) {
+ ir_rvalue *param_rval = (ir_rvalue *) actual_node;
+ ir_variable *sig_param = (ir_variable *) formal_node;
if (sig_param->data.mode == ir_var_function_in
|| sig_param->data.mode == ir_var_const_in) {
@@ -136,7 +136,6 @@ ir_constant_folding_visitor::visit_enter(ir_call *ir)
param_rval->replace_with(new_param);
}
}
- sig_iter.next();
}
/* Next, see if the call can be replaced with an assignment of a constant */