summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-07-27 11:29:17 -0700
committerEric Anholt <eric@anholt.net>2010-07-27 11:46:06 -0700
commit5532c4ca696fea32fb9b2f8de15beabe4a20ae15 (patch)
treef28c86c482b51d6a73f28daa5a28cbba74fb5261 /src
parent66d4c65ee2c311ea0c71c39a28456d0c11798d6b (diff)
glsl2: Fix the linked version of ir_dead_code.
If we don't walk into functions, we won't see any usage of variables in the functions.
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ir_dead_code.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/glsl/ir_dead_code.cpp b/src/glsl/ir_dead_code.cpp
index 4804407bdc..eab459b920 100644
--- a/src/glsl/ir_dead_code.cpp
+++ b/src/glsl/ir_dead_code.cpp
@@ -61,7 +61,7 @@ public:
virtual ir_visitor_status visit(ir_variable *);
virtual ir_visitor_status visit(ir_dereference_variable *);
- virtual ir_visitor_status visit_enter(ir_function *);
+ virtual ir_visitor_status visit_enter(ir_function_signature *);
virtual ir_visitor_status visit_leave(ir_assignment *);
variable_entry *get_variable_entry(ir_variable *var);
@@ -116,9 +116,12 @@ ir_dead_code_visitor::visit(ir_dereference_variable *ir)
ir_visitor_status
-ir_dead_code_visitor::visit_enter(ir_function *ir)
+ir_dead_code_visitor::visit_enter(ir_function_signature *ir)
{
- (void) ir;
+ /* We don't want to descend into the function parameters and
+ * dead-code eliminate them, so just accept the body here.
+ */
+ visit_list_elements(this, &ir->body);
return visit_continue_with_parent;
}