Make read-only variables not be considered lvalues.

This should fix tests trying to assign to builtin "in" variables, and
will also be relied on for post_inc/dec handling.
This commit is contained in:
Eric Anholt 2010-03-26 15:51:45 -07:00 committed by Ian Romanick
parent 3c36b2df7c
commit c4f86d3b80

12
ir.h
View file

@ -455,7 +455,17 @@ public:
bool is_lvalue()
{
return var != NULL;
ir_variable *as_var;
if (var == NULL)
return NULL;
as_var = var->as_variable();
if (as_var == NULL)
return NULL;
return !as_var->read_only;
}
enum {