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

This commit is contained in:
Matteo Bruni 2014-05-02 16:30:13 +02:00 committed by Alexandre Julliard
parent 89cac9c20d
commit d25486fba4
2 changed files with 9 additions and 9 deletions

View File

@ -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,

View File

@ -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
{