mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/hlsl: Factor out add_unary_expr().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
14e9a1ba1c
commit
9a627494a3
@ -1083,6 +1083,17 @@ static struct list *append_unop(struct list *list, struct hlsl_ir_node *node)
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct list *add_unary_expr(struct hlsl_ctx *ctx, struct list *instrs,
|
||||||
|
enum hlsl_ir_expr_op op, struct vkd3d_shader_location loc)
|
||||||
|
{
|
||||||
|
struct hlsl_ir_node *expr;
|
||||||
|
|
||||||
|
if (!(expr = hlsl_new_unary_expr(ctx, op, node_from_list(instrs), loc)))
|
||||||
|
return NULL;
|
||||||
|
list_add_tail(instrs, &expr->entry);
|
||||||
|
return instrs;
|
||||||
|
}
|
||||||
|
|
||||||
static struct list *add_binary_expr(struct hlsl_ctx *ctx, struct list *list1, struct list *list2,
|
static struct list *add_binary_expr(struct hlsl_ctx *ctx, struct list *list1, struct list *list2,
|
||||||
enum hlsl_ir_expr_op op, struct vkd3d_shader_location loc)
|
enum hlsl_ir_expr_op op, struct vkd3d_shader_location loc)
|
||||||
{
|
{
|
||||||
@ -3033,7 +3044,7 @@ unary_expr:
|
|||||||
if ($1 == UNARY_OP_PLUS)
|
if ($1 == UNARY_OP_PLUS)
|
||||||
$$ = $2;
|
$$ = $2;
|
||||||
else
|
else
|
||||||
$$ = append_unop($2, hlsl_new_unary_expr(ctx, ops[$1], node_from_list($2), @1));
|
$$ = add_unary_expr(ctx, $2, ops[$1], @1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* var_modifiers is necessary to avoid shift/reduce conflicts. */
|
/* var_modifiers is necessary to avoid shift/reduce conflicts. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user