summaryrefslogtreecommitdiff
path: root/ir_dead_code.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ir_dead_code.cpp')
-rw-r--r--ir_dead_code.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/ir_dead_code.cpp b/ir_dead_code.cpp
index aae45d9..81fbeba 100644
--- a/ir_dead_code.cpp
+++ b/ir_dead_code.cpp
@@ -62,7 +62,6 @@ public:
*/
/*@{*/
virtual void visit(ir_variable *);
- virtual void visit(ir_label *);
virtual void visit(ir_loop *);
virtual void visit(ir_loop_jump *);
virtual void visit(ir_function_signature *);
@@ -122,12 +121,6 @@ ir_dead_code_visitor::visit(ir_variable *ir)
void
-ir_dead_code_visitor::visit(ir_label *ir)
-{
- ir->signature->accept(this);
-}
-
-void
ir_dead_code_visitor::visit(ir_loop *ir)
{
find_dead_code(&ir->body_instructions, this);
@@ -325,10 +318,14 @@ do_dead_code_unlinked(exec_list *instructions)
foreach_iter(exec_list_iterator, iter, *instructions) {
ir_instruction *ir = (ir_instruction *)iter.get();
- ir_label *label = ir->as_label();
- if (label) {
- if (do_dead_code(&label->signature->body))
- progress = true;
+ ir_function *f = ir->as_function();
+ if (f) {
+ foreach_iter(exec_list_iterator, sigiter, *f) {
+ ir_function_signature *sig =
+ (ir_function_signature *) sigiter.get();
+ if (do_dead_code(&sig->body))
+ progress = true;
+ }
}
}