From 72931553828af0ce85f0562b9ff8ec7f4d28e050 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 8 Feb 2019 17:02:22 +0100 Subject: 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 --- include/expression.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') 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; } -- cgit v1.2.3