aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir_hv_accept.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-09-26 17:04:30 +0200
committermarha <marha@users.sourceforge.net>2011-09-26 17:04:30 +0200
commit873965b49f283ad028dd4e0e5b7e93a758c84993 (patch)
tree84122d76cb641b54ea85cee9b631fb51c25052b5 /mesalib/src/glsl/ir_hv_accept.cpp
parentc1e6c7428a8d2c1b60ffac7df7a3f56c300fa983 (diff)
downloadvcxsrv-873965b49f283ad028dd4e0e5b7e93a758c84993.tar.gz
vcxsrv-873965b49f283ad028dd4e0e5b7e93a758c84993.tar.bz2
vcxsrv-873965b49f283ad028dd4e0e5b7e93a758c84993.zip
fontconfig libX11 libXext libXft libXmu mesa git update 26 sep 2011
Diffstat (limited to 'mesalib/src/glsl/ir_hv_accept.cpp')
-rw-r--r--mesalib/src/glsl/ir_hv_accept.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/mesalib/src/glsl/ir_hv_accept.cpp b/mesalib/src/glsl/ir_hv_accept.cpp
index d33fc85bf..0e78fda81 100644
--- a/mesalib/src/glsl/ir_hv_accept.cpp
+++ b/mesalib/src/glsl/ir_hv_accept.cpp
@@ -30,7 +30,13 @@
*/
/**
- * Process a list of nodes using a hierarchical vistor
+ * Process a list of nodes using a hierarchical vistor.
+ *
+ * If statement_list is true (the default), this is a list of statements, so
+ * v->base_ir will be set to point to each statement just before iterating
+ * over it, and restored after iteration is complete. If statement_list is
+ * false, this is a list that appears inside a statement (e.g. a parameter
+ * list), so v->base_ir will be left alone.
*
* \warning
* This function will operate correctly if a node being processed is removed
@@ -38,19 +44,22 @@
* processed, some of the added nodes may not be processed.
*/
ir_visitor_status
-visit_list_elements(ir_hierarchical_visitor *v, exec_list *l)
+visit_list_elements(ir_hierarchical_visitor *v, exec_list *l,
+ bool statement_list)
{
ir_instruction *prev_base_ir = v->base_ir;
foreach_list_safe(n, l) {
ir_instruction *const ir = (ir_instruction *) n;
- v->base_ir = ir;
+ if (statement_list)
+ v->base_ir = ir;
ir_visitor_status s = ir->accept(v);
if (s != visit_continue)
return s;
}
- v->base_ir = prev_base_ir;
+ if (statement_list)
+ v->base_ir = prev_base_ir;
return visit_continue;
}
@@ -129,7 +138,7 @@ ir_function::accept(ir_hierarchical_visitor *v)
if (s != visit_continue)
return (s == visit_continue_with_parent) ? visit_continue : s;
- s = visit_list_elements(v, &this->signatures);
+ s = visit_list_elements(v, &this->signatures, false);
return (s == visit_stop) ? s : v->visit_leave(this);
}
@@ -317,7 +326,7 @@ ir_call::accept(ir_hierarchical_visitor *v)
if (s != visit_continue)
return (s == visit_continue_with_parent) ? visit_continue : s;
- s = visit_list_elements(v, &this->actual_parameters);
+ s = visit_list_elements(v, &this->actual_parameters, false);
if (s == visit_stop)
return s;