#include "ir_expression_flattening.h"
#include "glsl_types.h"
+namespace {
+
class signature_entry : public exec_node
{
public:
ir_dead_functions_visitor()
{
this->mem_ctx = ralloc_context(NULL);
- this->seen_another_function_signature = false;
}
~ir_dead_functions_visitor()
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)
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;
}
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;