glsl: Generate strings that are the enum names without the ir_*op_ prefix
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 15 Sep 2016 18:26:28 +0000 (11:26 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 10 Nov 2016 22:30:49 +0000 (14:30 -0800)
For many expressions, this is different from the printable name.  The
printable name for ir_binop_add is "+", but we want "add".  This is
needed for ir_builder_print_visitor.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/compiler/glsl/ir.h
src/compiler/glsl/ir_expression_operation.py

index 433ba19..24f510e 100644 (file)
@@ -1471,6 +1471,7 @@ public:
 #include "ir_expression_operation.h"
 
 extern const char *const ir_expression_operation_strings[ir_last_opcode + 1];
+extern const char *const ir_expression_operation_enum_strings[ir_last_opcode + 1];
 
 class ir_expression : public ir_rvalue {
 public:
index 9aa08d3..58a585b 100644 (file)
@@ -707,6 +707,12 @@ const char *const ir_expression_operation_strings[] = {
 % for item in values:
    "${item.printable_name}",
 % endfor
+};
+
+const char *const ir_expression_operation_enum_strings[] = {
+% for item in values:
+   "${item.name}",
+% endfor
 };""")
 
    constant_template = mako.template.Template("""\