[qfcc] Add a function to check for error expressions

I haven't gone through and replaced all the existing tests, but hiding
the details makes sense and fits with many of the other check functions.
This commit is contained in:
Bill Currie 2024-04-30 11:07:53 +09:00
parent f7bf77c2b7
commit fed1bce12a
2 changed files with 8 additions and 0 deletions

View file

@ -740,6 +740,8 @@ unsigned short expr_ushort (const expr_t *e) __attribute__((pure));
int expr_integral (const expr_t *e) __attribute__((pure));
bool is_error (const expr_t *e) __attribute__((pure));
/** Check if the expression refers to a constant value.
\param e The expression to check.

View file

@ -861,6 +861,12 @@ new_short_expr (short short_val)
return new_value_expr (new_short_val (short_val), false);
}
bool
is_error (const expr_t *e)
{
return e->type == ex_error;
}
int
is_constant (const expr_t *e)
{