Commit d25486fb authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

d3dcompiler: Pre/post increment/decrement operators are unary.

parent 89cac9c2
......@@ -826,6 +826,11 @@ enum hlsl_ir_expr_op {
HLSL_IR_UNOP_SAT,
HLSL_IR_UNOP_PREINC,
HLSL_IR_UNOP_PREDEC,
HLSL_IR_UNOP_POSTINC,
HLSL_IR_UNOP_POSTDEC,
HLSL_IR_BINOP_ADD,
HLSL_IR_BINOP_SUB,
HLSL_IR_BINOP_MUL,
......@@ -856,11 +861,6 @@ enum hlsl_ir_expr_op {
HLSL_IR_BINOP_POW,
HLSL_IR_BINOP_PREINC,
HLSL_IR_BINOP_PREDEC,
HLSL_IR_BINOP_POSTINC,
HLSL_IR_BINOP_POSTDEC,
HLSL_IR_TEROP_LERP,
HLSL_IR_SEQUENCE,
......
......@@ -1848,7 +1848,7 @@ postfix_expr: primary_expr
}
operands[0] = $1;
operands[1] = operands[2] = NULL;
$$ = &new_expr(HLSL_IR_BINOP_POSTINC, operands, &loc)->node;
$$ = &new_expr(HLSL_IR_UNOP_POSTINC, operands, &loc)->node;
/* Post increment/decrement expressions are considered const */
$$->data_type = clone_hlsl_type($$->data_type);
$$->data_type->modifiers |= HLSL_MODIFIER_CONST;
......@@ -1867,7 +1867,7 @@ postfix_expr: primary_expr
}
operands[0] = $1;
operands[1] = operands[2] = NULL;
$$ = &new_expr(HLSL_IR_BINOP_POSTDEC, operands, &loc)->node;
$$ = &new_expr(HLSL_IR_UNOP_POSTDEC, operands, &loc)->node;
/* Post increment/decrement expressions are considered const */
$$->data_type = clone_hlsl_type($$->data_type);
$$->data_type->modifiers |= HLSL_MODIFIER_CONST;
......@@ -2040,7 +2040,7 @@ unary_expr: postfix_expr
}
operands[0] = $2;
operands[1] = operands[2] = NULL;
$$ = &new_expr(HLSL_IR_BINOP_PREINC, operands, &loc)->node;
$$ = &new_expr(HLSL_IR_UNOP_PREINC, operands, &loc)->node;
}
| OP_DEC unary_expr
{
......@@ -2056,7 +2056,7 @@ unary_expr: postfix_expr
}
operands[0] = $2;
operands[1] = operands[2] = NULL;
$$ = &new_expr(HLSL_IR_BINOP_PREDEC, operands, &loc)->node;
$$ = &new_expr(HLSL_IR_UNOP_PREDEC, operands, &loc)->node;
}
| unary_op unary_expr
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment