[qfcc] Add pointer value check

Extraction is a little more complicated, though, so undecided on that.
This commit is contained in:
Bill Currie 2020-03-17 11:19:12 +09:00
parent c3f04384d5
commit 9cb3ee01d6
2 changed files with 10 additions and 0 deletions

View file

@ -618,6 +618,7 @@ int is_integer_val (expr_t *e) __attribute__((pure));
int is_uinteger_val (expr_t *e) __attribute__((pure));
int is_short_val (expr_t *e) __attribute__((pure));
int is_integral_val (expr_t *e) __attribute__((pure));
int is_pointer_val (expr_t *e) __attribute__((pure));
/** Create a reference to the global <code>.self</code> entity variable.

View file

@ -1193,6 +1193,15 @@ expr_integral (expr_t *e)
internal_error (e, "not an integral constant");
}
int
is_pointer_val (expr_t *e)
{
if (e->type == ex_value && e->e.value->lltype == ev_pointer) {
return 1;
}
return 0;
}
expr_t *
new_alias_expr (type_t *type, expr_t *expr)
{