summaryrefslogtreecommitdiffstats
path: root/include/expression.h
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-02-08 17:02:22 +0100
committerFlorian Westphal <fw@strlen.de>2019-02-08 21:22:51 +0100
commit72931553828af0ce85f0562b9ff8ec7f4d28e050 (patch)
tree6fe42e2a99febc3ff783f63b8219de81215cf0d3 /include/expression.h
parent2cc91e6198e7ee8b9d0f8727c67a849fec393cd0 (diff)
src: expr: add expression etype
Temporary kludge to remove all the expr->ops->type == ... patterns. Followup patch will remove expr->ops, and make expr_ops() lookup the correct expr_ops struct instead to reduce struct expr size. Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'include/expression.h')
-rw-r--r--include/expression.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/expression.h b/include/expression.h
index 8a4cf5b1..2450bc90 100644
--- a/include/expression.h
+++ b/include/expression.h
@@ -220,6 +220,7 @@ struct expr {
const struct datatype *dtype;
enum byteorder byteorder;
+ enum expr_types etype:8;
unsigned int len;
const struct expr_ops *ops;
@@ -411,7 +412,7 @@ const char *expr_name(const struct expr *e);
static inline void symbol_expr_set_type(struct expr *expr,
const struct datatype *dtype)
{
- if (expr->ops->type == EXPR_SYMBOL)
+ if (expr->etype == EXPR_SYMBOL)
expr->dtype = dtype;
}