mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Add an offset alias expression
This should make dealing with def elements (vector etc) easier.
This commit is contained in:
parent
efdfc7436f
commit
913b9f52e0
2 changed files with 13 additions and 0 deletions
|
@ -558,6 +558,7 @@ expr_t *new_this_expr (void);
|
|||
expr_t *new_ret_expr (struct type_s *type);
|
||||
|
||||
expr_t *new_alias_expr (struct type_s *type, expr_t *expr);
|
||||
expr_t *new_offset_alias_expr (struct type_s *type, expr_t *expr, int offset);
|
||||
|
||||
/** Create an expression of the correct type that references the specified
|
||||
parameter slot.
|
||||
|
|
|
@ -1025,6 +1025,18 @@ new_alias_expr (type_t *type, expr_t *expr)
|
|||
return alias;
|
||||
}
|
||||
|
||||
expr_t *
|
||||
new_offset_alias_expr (type_t *type, expr_t *expr, int offset)
|
||||
{
|
||||
expr_t *alias;
|
||||
|
||||
alias = new_binary_expr ('A', expr, new_integer_expr (offset));
|
||||
alias->e.expr.type = type;
|
||||
alias->file = expr->file;
|
||||
alias->line = expr->line;
|
||||
return alias;
|
||||
}
|
||||
|
||||
static expr_t *
|
||||
param_expr (const char *name, type_t *type)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue