From 13f57d42b6929f50d8ef8b4123f46a61c46fde7b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 9 Nov 2010 14:19:10 -0800 Subject: glsl: Add unary ir_expression constructor --- src/glsl/ir.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/glsl/ir.cpp') diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp index 308b7c2010..1f5e2ebdcb 100644 --- a/src/glsl/ir.cpp +++ b/src/glsl/ir.cpp @@ -191,9 +191,22 @@ ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs, } +ir_expression::ir_expression(int op, const struct glsl_type *type, + ir_rvalue *op0) +{ + assert(get_num_operands(ir_expression_operation(op)) == 1); + this->ir_type = ir_type_expression; + this->type = type; + this->operation = ir_expression_operation(op); + this->operands[0] = op0; + this->operands[1] = NULL; +} + ir_expression::ir_expression(int op, const struct glsl_type *type, ir_rvalue *op0, ir_rvalue *op1) { + assert((op1 == NULL) && (get_num_operands(ir_expression_operation(op)) == 1) + || (get_num_operands(ir_expression_operation(op)) == 2)); this->ir_type = ir_type_expression; this->type = type; this->operation = ir_expression_operation(op); -- cgit v1.2.3