From a1e97828c89278770cb249039ec92d959440c640 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 9 Jan 2012 16:34:28 +0100 Subject: xwininfo libX11 mesa mkfontscale xkeyboard-config git update 9 jan 2011 --- mesalib/src/glsl/ast_to_hir.cpp | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'mesalib/src/glsl/ast_to_hir.cpp') diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp index f0c921875..1aebca40f 100644 --- a/mesalib/src/glsl/ast_to_hir.cpp +++ b/mesalib/src/glsl/ast_to_hir.cpp @@ -664,6 +664,7 @@ mark_whole_array_access(ir_rvalue *access) ir_rvalue * do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, + const char *non_lvalue_description, ir_rvalue *lhs, ir_rvalue *rhs, bool is_initializer, YYLTYPE lhs_loc) { @@ -671,8 +672,13 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, bool error_emitted = (lhs->type->is_error() || rhs->type->is_error()); if (!error_emitted) { - if (lhs->variable_referenced() != NULL - && lhs->variable_referenced()->read_only) { + if (non_lvalue_description != NULL) { + _mesa_glsl_error(&lhs_loc, state, + "assignment to %s", + non_lvalue_description); + error_emitted = true; + } else if (lhs->variable_referenced() != NULL + && lhs->variable_referenced()->read_only) { _mesa_glsl_error(&lhs_loc, state, "assignment to read-only variable '%s'", lhs->variable_referenced()->name); @@ -769,11 +775,6 @@ get_lvalue_copy(exec_list *instructions, ir_rvalue *lvalue) instructions->push_tail(new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var), lvalue, NULL)); - /* Once we've created this temporary, mark it read only so it's no - * longer considered an lvalue. - */ - var->read_only = true; - return new(ctx) ir_dereference_variable(var); } @@ -1030,7 +1031,9 @@ ast_expression::hir(exec_list *instructions, op[0] = this->subexpressions[0]->hir(instructions, state); op[1] = this->subexpressions[1]->hir(instructions, state); - result = do_assignment(instructions, state, op[0], op[1], false, + result = do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, + op[0], op[1], false, this->subexpressions[0]->get_location()); error_emitted = result->type->is_error(); break; @@ -1310,6 +1313,7 @@ ast_expression::hir(exec_list *instructions, op[0], op[1]); result = do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, op[0]->clone(ctx, NULL), temp_rhs, false, this->subexpressions[0]->get_location()); error_emitted = (op[0]->type->is_error()); @@ -1335,6 +1339,7 @@ ast_expression::hir(exec_list *instructions, op[0], op[1]); result = do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, op[0]->clone(ctx, NULL), temp_rhs, false, this->subexpressions[0]->get_location()); error_emitted = type->is_error(); @@ -1349,8 +1354,9 @@ ast_expression::hir(exec_list *instructions, &loc); ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper], type, op[0], op[1]); - result = do_assignment(instructions, state, op[0]->clone(ctx, NULL), - temp_rhs, false, + result = do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, + op[0]->clone(ctx, NULL), temp_rhs, false, this->subexpressions[0]->get_location()); error_emitted = op[0]->type->is_error() || op[1]->type->is_error(); break; @@ -1365,8 +1371,9 @@ ast_expression::hir(exec_list *instructions, state, &loc); ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper], type, op[0], op[1]); - result = do_assignment(instructions, state, op[0]->clone(ctx, NULL), - temp_rhs, false, + result = do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, + op[0]->clone(ctx, NULL), temp_rhs, false, this->subexpressions[0]->get_location()); error_emitted = op[0]->type->is_error() || op[1]->type->is_error(); break; @@ -1463,6 +1470,9 @@ ast_expression::hir(exec_list *instructions, case ast_pre_inc: case ast_pre_dec: { + this->non_lvalue_description = (this->oper == ast_pre_inc) + ? "pre-increment operation" : "pre-decrement operation"; + op[0] = this->subexpressions[0]->hir(instructions, state); op[1] = constant_one_for_inc_dec(ctx, op[0]->type); @@ -1473,6 +1483,7 @@ ast_expression::hir(exec_list *instructions, op[0], op[1]); result = do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, op[0]->clone(ctx, NULL), temp_rhs, false, this->subexpressions[0]->get_location()); error_emitted = op[0]->type->is_error(); @@ -1481,6 +1492,8 @@ ast_expression::hir(exec_list *instructions, case ast_post_inc: case ast_post_dec: { + this->non_lvalue_description = (this->oper == ast_post_inc) + ? "post-increment operation" : "post-decrement operation"; op[0] = this->subexpressions[0]->hir(instructions, state); op[1] = constant_one_for_inc_dec(ctx, op[0]->type); @@ -1498,6 +1511,7 @@ ast_expression::hir(exec_list *instructions, result = get_lvalue_copy(instructions, op[0]->clone(ctx, NULL)); (void)do_assignment(instructions, state, + this->subexpressions[0]->non_lvalue_description, op[0]->clone(ctx, NULL), temp_rhs, false, this->subexpressions[0]->get_location()); @@ -2365,6 +2379,7 @@ process_initializer(ir_variable *var, ast_declaration *decl, const glsl_type *initializer_type; if (!type->qualifier.flags.q.uniform) { result = do_assignment(initializer_instructions, state, + NULL, lhs, rhs, true, type->get_location()); initializer_type = result->type; -- cgit v1.2.3