d3dcompiler: Get rid of the "node" field from struct hlsl_ir_function_decl.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-08-13 10:23:31 -05:00 committed by Alexandre Julliard
parent a20295ce3d
commit 32fd9ff479
3 changed files with 13 additions and 15 deletions

View File

@ -712,7 +712,6 @@ enum hlsl_ir_node_type
HLSL_IR_CONSTRUCTOR,
HLSL_IR_DEREF,
HLSL_IR_EXPR,
HLSL_IR_FUNCTION_DECL,
HLSL_IR_IF,
HLSL_IR_LOOP,
HLSL_IR_JUMP,
@ -776,7 +775,8 @@ struct hlsl_ir_function
struct hlsl_ir_function_decl
{
struct hlsl_ir_node node;
struct hlsl_type *return_type;
struct source_location loc;
struct wine_rb_entry entry;
struct hlsl_ir_function *func;
const char *semantic;

View File

@ -1084,28 +1084,28 @@ hlsl_prog: /* empty */
{
if (decl->body && $2.decl->body)
{
hlsl_report_message($2.decl->node.loc.file, $2.decl->node.loc.line,
$2.decl->node.loc.col, HLSL_LEVEL_ERROR,
hlsl_report_message($2.decl->loc.file, $2.decl->loc.line,
$2.decl->loc.col, HLSL_LEVEL_ERROR,
"redefinition of function %s", debugstr_a($2.name));
YYABORT;
}
else if (!compare_hlsl_types(decl->node.data_type, $2.decl->node.data_type))
else if (!compare_hlsl_types(decl->return_type, $2.decl->return_type))
{
hlsl_report_message($2.decl->node.loc.file, $2.decl->node.loc.line,
$2.decl->node.loc.col, HLSL_LEVEL_ERROR,
hlsl_report_message($2.decl->loc.file, $2.decl->loc.line,
$2.decl->loc.col, HLSL_LEVEL_ERROR,
"redefining function %s with a different return type",
debugstr_a($2.name));
hlsl_report_message(decl->node.loc.file, decl->node.loc.line, decl->node.loc.col, HLSL_LEVEL_NOTE,
hlsl_report_message(decl->loc.file, decl->loc.line, decl->loc.col, HLSL_LEVEL_NOTE,
"%s previously declared here",
debugstr_a($2.name));
YYABORT;
}
}
if ($2.decl->node.data_type->base_type == HLSL_TYPE_VOID && $2.decl->semantic)
if ($2.decl->return_type->base_type == HLSL_TYPE_VOID && $2.decl->semantic)
{
hlsl_report_message($2.decl->node.loc.file, $2.decl->node.loc.line,
$2.decl->node.loc.col, HLSL_LEVEL_ERROR,
hlsl_report_message($2.decl->loc.file, $2.decl->loc.line,
$2.decl->loc.col, HLSL_LEVEL_ERROR,
"void function with a semantic");
}
@ -1280,7 +1280,7 @@ func_prototype: var_modifiers type var_identifier '(' parameters ')' c
}
$$.name = $3;
$$.decl->semantic = $7.semantic;
set_location(&$$.decl->node.loc, &@3);
set_location(&$$.decl->loc, &@3);
}
compound_statement: '{' '}'

View File

@ -1577,8 +1577,7 @@ struct hlsl_ir_function_decl *new_func_decl(struct hlsl_type *return_type, struc
ERR("Out of memory.\n");
return NULL;
}
decl->node.type = HLSL_IR_FUNCTION_DECL;
decl->node.data_type = return_type;
decl->return_type = return_type;
decl->parameters = parameters;
return decl;
@ -1775,7 +1774,6 @@ static const char *debug_node_type(enum hlsl_ir_node_type type)
"HLSL_IR_CONSTRUCTOR",
"HLSL_IR_DEREF",
"HLSL_IR_EXPR",
"HLSL_IR_FUNCTION_DECL",
"HLSL_IR_IF",
"HLSL_IR_JUMP",
"HLSL_IR_SWIZZLE",