Use line number information from entire function expression
[mesa.git] / src / glsl / opt_dead_functions.cpp
index 7c64c618c0ca4b683bccb0d21063de55547462ee..cd3b2c12e896381a16898bb974d22dc1df32d34f 100644 (file)
@@ -32,6 +32,8 @@
 #include "ir_expression_flattening.h"
 #include "glsl_types.h"
 
+namespace {
+
 class signature_entry : public exec_node
 {
 public:
@@ -50,7 +52,6 @@ public:
    ir_dead_functions_visitor()
    {
       this->mem_ctx = ralloc_context(NULL);
-      this->seen_another_function_signature = false;
    }
 
    ~ir_dead_functions_visitor()
@@ -63,15 +64,12 @@ public:
 
    signature_entry *get_signature_entry(ir_function_signature *var);
 
-   bool (*predicate)(ir_instruction *ir);
-
-   bool seen_another_function_signature;
-
    /* List of signature_entry */
    exec_list signature_list;
    void *mem_ctx;
 };
 
+} /* unnamed namespace */
 
 signature_entry *
 ir_dead_functions_visitor::get_signature_entry(ir_function_signature *sig)
@@ -97,13 +95,7 @@ ir_dead_functions_visitor::visit_enter(ir_function_signature *ir)
       entry->used = true;
    }
 
-   /* If this is the first signature to look at, no need to descend to see
-    * if it has calls to another function signature.
-    */
-   if (!this->seen_another_function_signature) {
-      this->seen_another_function_signature = true;
-      return visit_continue_with_parent;
-   }
+
 
    return visit_continue;
 }
@@ -112,7 +104,7 @@ ir_dead_functions_visitor::visit_enter(ir_function_signature *ir)
 ir_visitor_status
 ir_dead_functions_visitor::visit_enter(ir_call *ir)
 {
-   signature_entry *entry = this->get_signature_entry(ir->get_callee());
+   signature_entry *entry = this->get_signature_entry(ir->callee);
 
    entry->used = true;