vkd3d-shader/hlsl: Store the function body directly in the hlsl_ir_function_decl structure.

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:
Zebediah Figura
2021-10-15 16:54:09 -05:00
committed by Alexandre Julliard
parent 423213fb05
commit 8485a7c450
6 changed files with 31 additions and 27 deletions

View File

@@ -2053,7 +2053,7 @@ hlsl_prog:
decl = get_func_decl(&ctx->functions, $2.name, $2.decl->parameters);
if (decl && !decl->func->intrinsic)
{
if (decl->body && $2.decl->body)
if (decl->has_body && $2.decl->has_body)
{
hlsl_error(ctx, $2.decl->loc, VKD3D_SHADER_ERROR_HLSL_REDEFINED,
"Function \"%s\" is already defined.", $2.name);
@@ -2247,7 +2247,9 @@ func_declaration:
func_prototype compound_statement
{
$$ = $1;
$$.decl->body = $2;
$$.decl->has_body = true;
list_move_tail(&$$.decl->body, $2);
vkd3d_free($2);
hlsl_pop_scope(ctx);
}
| func_prototype ';'