X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglsl%2Fir_print_visitor.h;h=6c308f31e9563d7dcf3ec3858cf28553a98178e5;hb=b37930f309a2e04f242a171152cb7c6c4300266a;hp=4feeb8c184dd79580ea612cbc3da2d7622ddbf21;hpb=bf496862be1ba863285aa2c1a2262b2d764c3e53;p=mesa.git diff --git a/src/glsl/ir_print_visitor.h b/src/glsl/ir_print_visitor.h index 4feeb8c184d..6c308f31e95 100644 --- a/src/glsl/ir_print_visitor.h +++ b/src/glsl/ir_print_visitor.h @@ -29,6 +29,10 @@ #include "ir.h" #include "ir_visitor.h" +extern "C" { +#include "program/symbol_table.h" +} + extern void _mesa_print_ir(exec_list *instructions, struct _mesa_glsl_parse_state *state); @@ -37,15 +41,8 @@ extern void _mesa_print_ir(exec_list *instructions, */ class ir_print_visitor : public ir_visitor { public: - ir_print_visitor() - { - indentation = 0; - } - - virtual ~ir_print_visitor() - { - /* empty */ - } + ir_print_visitor(); + virtual ~ir_print_visitor(); void indent(void); @@ -57,6 +54,7 @@ public: * the hierarchy should not have \c visit methods. */ /*@{*/ + virtual void visit(ir_rvalue *); virtual void visit(ir_variable *); virtual void visit(ir_function_signature *); virtual void visit(ir_function *); @@ -77,6 +75,20 @@ public: /*@}*/ private: + /** + * Fetch/generate a unique name for ir_variable. + * + * GLSL IR permits multiple ir_variables to share the same name. This works + * fine until we try to print it, when we really need a unique one. + */ + const char *unique_name(ir_variable *var); + + /** A mapping from ir_variable * -> unique printable names. */ + hash_table *printable_names; + _mesa_symbol_table *symbols; + + void *mem_ctx; + int indentation; };