summaryrefslogtreecommitdiff
path: root/ir.h
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-04-07 17:18:29 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-28 15:42:07 -0700
commit3b96996b7eb6e3603a5f138177867c3e856e0dfa (patch)
tree0dad0ce7c51cad062115e44fa31b7c798a34052c /ir.h
parentbff6013d469b3d4e54cdc5731801c56994a523ec (diff)
Move array of operator strings out of ir_print_visitor.cpp.
Also implement a reverse-lookup function for use in the IR reader.
Diffstat (limited to 'ir.h')
-rw-r--r--ir.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/ir.h b/ir.h
index df64e48823..42e8264d41 100644
--- a/ir.h
+++ b/ir.h
@@ -415,9 +415,9 @@ public:
ir_rvalue *condition;
};
-/* Update ir_expression::num_operands() and ir_print_visitor.cpp when
+/* Update ir_expression::num_operands() and operator_strs when
* updating this list.
-*/
+ */
enum ir_expression_operation {
ir_unop_bit_not,
ir_unop_logic_not,
@@ -498,6 +498,16 @@ public:
return get_num_operands(operation);
}
+ /**
+ * Return a string representing this expression's operator.
+ */
+ const char *operator_string();
+
+ /**
+ * Do a reverse-lookup to translate the given string into an operator.
+ */
+ static ir_expression_operation get_operator(const char *);
+
virtual void accept(ir_visitor *v)
{
v->visit(this);