summaryrefslogtreecommitdiff
path: root/ir.h
diff options
context:
space:
mode:
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);