summaryrefslogtreecommitdiff
path: root/ir.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-03-26 15:51:45 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-26 17:51:41 -0700
commitc4f86d3b80047ce3a8be1fa69396856af1719bc9 (patch)
tree8382f1ba0f5cd84fc6e1209dce9204debd07d373 /ir.h
parent3c36b2df7c854d23b2be9580e416fb04079a1bef (diff)
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.
Diffstat (limited to 'ir.h')
-rw-r--r--ir.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/ir.h b/ir.h
index a69f932c5a..7e2f304b41 100644
--- a/ir.h
+++ b/ir.h
@@ -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 {