summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-08-27 13:53:25 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-09-03 11:55:21 -0700
commit351525d534268b08c090f9ce42a67e9329a969ae (patch)
treef6133719f45c2c2b26a705937e69e2afc8dcde69 /src/glsl/ir.cpp
parent79082b8aca130ecdcaa1167a9961c16fc620f423 (diff)
ir_expression: Add static operator_string method
I've used this in quite a few debug commits that never reached an up-stream tree.
Diffstat (limited to 'src/glsl/ir.cpp')
-rw-r--r--src/glsl/ir.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 96b32a2f34b..6d727253740 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