diff options
Diffstat (limited to 'ir.h')
-rw-r--r-- | ir.h | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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); |