summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_reader.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-01-10 17:08:33 -0800
committerKenneth Graunke <[email protected]>2014-01-13 11:49:45 -0800
commit826d9fb8c030096d94aa3d09180bc76c532cac1b (patch)
tree25da71b122227c7c7f39b8b14b64e22cbaee4ce1 /src/glsl/ir_reader.cpp
parent48d0faaa4388f411ea64fef8f4be04c22d02a4cf (diff)
glsl: Replace iterators in ir_reader.cpp with ad-hoc list walking.
These can't use foreach_list since they want to skip over the first few list elements. Just doing the ad-hoc list walking isn't too bad. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/ir_reader.cpp')
-rw-r--r--src/glsl/ir_reader.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp
index f5185d28484..28923f3b8c0 100644
--- a/src/glsl/ir_reader.cpp
+++ b/src/glsl/ir_reader.cpp
@@ -205,11 +205,12 @@ ir_reader::read_function(s_expression *expr, bool skip_body)
assert(added);
}
- exec_list_iterator it = ((s_list *) expr)->subexpressions.iterator();
- it.next(); // skip "function" tag
- it.next(); // skip function name
- for (/* nothing */; it.has_next(); it.next()) {
- s_expression *s_sig = (s_expression *) it.get();
+ /* Skip over "function" tag and function name (which are guaranteed to be
+ * present by the above PARTIAL_MATCH call).
+ */
+ exec_node *node = ((s_list *) expr)->subexpressions.head->next->next;
+ for (/* nothing */; !node->is_tail_sentinel(); node = node->next) {
+ s_expression *s_sig = (s_expression *) node;
read_function_sig(f, s_sig, skip_body);
}
return added ? f : NULL;
@@ -249,9 +250,10 @@ ir_reader::read_function_sig(ir_function *f, s_expression *expr, bool skip_body)
exec_list hir_parameters;
state->symbols->push_scope();
- exec_list_iterator it = paramlist->subexpressions.iterator();
- for (it.next() /* skip "parameters" */; it.has_next(); it.next()) {
- ir_variable *var = read_declaration((s_expression *) it.get());
+ /* Skip over the "parameters" tag. */
+ exec_node *node = paramlist->subexpressions.head->next;
+ for (/* nothing */; !node->is_tail_sentinel(); node = node->next) {
+ ir_variable *var = read_declaration((s_expression *) node);
if (var == NULL)
return;