struct expr *set_elem_catchall_expr_alloc(const struct location *loc);
+#define expr_type_catchall(__expr) \
+ ((__expr)->etype == EXPR_SET_ELEM_CATCHALL)
+
extern void range_expr_value_low(mpz_t rop, const struct expr *expr);
extern void range_expr_value_high(mpz_t rop, const struct expr *expr);
void range_expr_swap_values(struct expr *range);
const struct expr *elem_key)
{
/* Catchall element is always compatible with the set key declaration */
- if (elem_key->etype == EXPR_SET_ELEM_CATCHALL)
+ if (expr_type_catchall(elem_key))
return true;
return datatype_compatible(set_key->dtype, elem_key->dtype);
mpz_init(rop);
list_for_each_entry_safe(i, next, &expr_set(ctx->init)->expressions, list) {
- if (i->key->etype == EXPR_SET_ELEM_CATCHALL)
+ if (expr_type_catchall(i->key))
continue;
range_expr_value_low(range.low, i);
list_for_each_entry_safe(elem, next, &expr_set(elems)->expressions, list) {
i = interval_expr_key(elem);
- if (i->key->etype == EXPR_SET_ELEM_CATCHALL) {
+ if (expr_type_catchall(i->key)) {
/* Assume max value to simplify handling. */
mpz_bitmask(range.low, i->len);
mpz_bitmask(range.high, i->len);
list_for_each_entry_safe(elem, next, &expr_set(init)->expressions, list) {
i = interval_expr_key(elem);
- if (i->key->etype == EXPR_SET_ELEM_CATCHALL)
+ if (expr_type_catchall(i->key))
continue;
range_expr_value_low(range.low, i);
list_for_each_entry_safe(i, n, &expr_set(init)->expressions, list) {
elem = interval_expr_key(i);
- if (elem->key->etype == EXPR_SET_ELEM_CATCHALL)
+ if (expr_type_catchall(elem->key))
continue;
if (prev)
bool adjacent = false;
key = setelem_key(elem);
- if (key->etype == EXPR_SET_ELEM_CATCHALL)
+ if (expr_type_catchall(key))
return 0;
if (next_elem) {
next_key = setelem_key(next_elem);
- if (next_key->etype == EXPR_SET_ELEM_CATCHALL)
+ if (expr_type_catchall(next_key))
next_key = NULL;
}