From f9f1e99099a03fff4e29991f8aebf2b84f2bcc99 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 9 Aug 2019 09:52:44 -0500 Subject: [PATCH] d3dcompiler: Get rid of the superfluous "variable" rule. Signed-off-by: Zebediah Figura Signed-off-by: Matteo Bruni Signed-off-by: Alexandre Julliard --- dlls/d3dcompiler_43/hlsl.y | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 4ece6695514..ba0fd5ceaff 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -913,7 +913,6 @@ static const struct hlsl_ir_function_decl *get_overloaded_func(struct wine_rb_tr BOOL boolval; char *name; DWORD modifiers; - struct hlsl_ir_var *var; struct hlsl_ir_node *instr; struct list *list; struct parse_function function; @@ -1049,7 +1048,6 @@ static const struct hlsl_ir_function_decl *get_overloaded_func(struct wine_rb_tr %type parameters %type param_list %type expr -%type variable %type array %type statement %type statement_list @@ -1910,10 +1908,19 @@ primary_expr: C_FLOAT c->v.value.b[0] = $1; $$ = &c->node; } - | variable + | VAR_IDENTIFIER { - struct hlsl_ir_deref *deref = new_var_deref($1); - if (deref) + struct hlsl_ir_deref *deref; + struct hlsl_ir_var *var; + + if (!(var = get_variable(hlsl_ctx.cur_scope, $1))) + { + hlsl_message("Line %d: variable '%s' not declared\n", + hlsl_ctx.line_no, $1); + set_parse_status(&hlsl_ctx.status, PARSE_ERR); + return 1; + } + if ((deref = new_var_deref(var))) { $$ = &deref->node; set_location(&$$->loc, &@1); @@ -1926,20 +1933,6 @@ primary_expr: C_FLOAT $$ = $2; } -variable: VAR_IDENTIFIER - { - struct hlsl_ir_var *var; - var = get_variable(hlsl_ctx.cur_scope, $1); - if (!var) - { - hlsl_message("Line %d: variable '%s' not declared\n", - hlsl_ctx.line_no, $1); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - return 1; - } - $$ = var; - } - postfix_expr: primary_expr { $$ = $1;