From 351525d534268b08c090f9ce42a67e9329a969ae Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 27 Aug 2010 13:53:25 -0700 Subject: ir_expression: Add static operator_string method I've used this in quite a few debug commits that never reached an up-stream tree. --- src/glsl/ir.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/glsl/ir.cpp') diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp index 96b32a2f34..6d72725374 100644 --- a/src/glsl/ir.cpp +++ b/src/glsl/ir.cpp @@ -287,11 +287,15 @@ static const char *const operator_strs[] = { "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 -- cgit v1.2.3