I've used this in quite a few debug commits that never reached an
up-stream tree.
"pow",
};
+const char *ir_expression::operator_string(ir_expression_operation op)
+{
+ assert((unsigned int) op < Elements(operator_strs));
+ return operator_strs[op];
+}
+
const char *ir_expression::operator_string()
{
- assert((unsigned int) operation <=
- sizeof(operator_strs) / sizeof(operator_strs[0]));
- return operator_strs[operation];
+ return operator_string(this->operation);
}
ir_expression_operation
const char *operator_string();
/**
+ * Return a string representing this expression's operator.
+ */
+ static const char *operator_string(ir_expression_operation);
+
+
+ /**
* Do a reverse-lookup to translate the given string into an operator.
*/
static ir_expression_operation get_operator(const char *);