Commit c7b90bf3 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

d3dcompiler: Pass the semantic and location parameters to new_func_decl().

parent 5900f001
...@@ -1096,7 +1096,6 @@ struct hlsl_ir_node *make_assignment(struct hlsl_ir_node *left, enum parse_assig ...@@ -1096,7 +1096,6 @@ struct hlsl_ir_node *make_assignment(struct hlsl_ir_node *left, enum parse_assig
struct hlsl_ir_node *right) DECLSPEC_HIDDEN; struct hlsl_ir_node *right) DECLSPEC_HIDDEN;
void push_scope(struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN; void push_scope(struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN;
BOOL pop_scope(struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN; BOOL pop_scope(struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN;
struct hlsl_ir_function_decl *new_func_decl(struct hlsl_type *return_type, struct list *parameters) DECLSPEC_HIDDEN;
void init_functions_tree(struct wine_rb_tree *funcs) DECLSPEC_HIDDEN; void init_functions_tree(struct wine_rb_tree *funcs) DECLSPEC_HIDDEN;
void add_function_decl(struct wine_rb_tree *funcs, char *name, struct hlsl_ir_function_decl *decl, void add_function_decl(struct wine_rb_tree *funcs, char *name, struct hlsl_ir_function_decl *decl,
BOOL intrinsic) DECLSPEC_HIDDEN; BOOL intrinsic) DECLSPEC_HIDDEN;
......
...@@ -1248,6 +1248,20 @@ static unsigned int evaluate_array_dimension(struct hlsl_ir_node *node) ...@@ -1248,6 +1248,20 @@ static unsigned int evaluate_array_dimension(struct hlsl_ir_node *node)
} }
} }
static struct hlsl_ir_function_decl *new_func_decl(struct hlsl_type *return_type,
struct list *parameters, const char *semantic, struct source_location loc)
{
struct hlsl_ir_function_decl *decl;
if (!(decl = d3dcompiler_alloc(sizeof(*decl))))
return NULL;
decl->return_type = return_type;
decl->parameters = parameters;
decl->semantic = semantic;
decl->loc = loc;
return decl;
}
%} %}
%locations %locations
...@@ -1648,15 +1662,12 @@ func_prototype: var_modifiers type var_identifier '(' parameters ')' c ...@@ -1648,15 +1662,12 @@ func_prototype: var_modifiers type var_identifier '(' parameters ')' c
FIXME("Unexpected register reservation for a function.\n"); FIXME("Unexpected register reservation for a function.\n");
d3dcompiler_free($7.reg_reservation); d3dcompiler_free($7.reg_reservation);
} }
$$.decl = new_func_decl($2, $5); if (!($$.decl = new_func_decl($2, $5, $7.semantic, get_location(&@3))))
if (!$$.decl)
{ {
ERR("Out of memory.\n"); ERR("Out of memory.\n");
YYABORT; YYABORT;
} }
$$.name = $3; $$.name = $3;
$$.decl->semantic = $7.semantic;
$$.decl->loc = get_location(&@3);
hlsl_ctx.cur_function = $$.decl; hlsl_ctx.cur_function = $$.decl;
} }
......
...@@ -1587,22 +1587,6 @@ BOOL pop_scope(struct hlsl_parse_ctx *ctx) ...@@ -1587,22 +1587,6 @@ BOOL pop_scope(struct hlsl_parse_ctx *ctx)
return TRUE; return TRUE;
} }
struct hlsl_ir_function_decl *new_func_decl(struct hlsl_type *return_type, struct list *parameters)
{
struct hlsl_ir_function_decl *decl;
decl = d3dcompiler_alloc(sizeof(*decl));
if (!decl)
{
ERR("Out of memory.\n");
return NULL;
}
decl->return_type = return_type;
decl->parameters = parameters;
return decl;
}
static int compare_param_hlsl_types(const struct hlsl_type *t1, const struct hlsl_type *t2) static int compare_param_hlsl_types(const struct hlsl_type *t1, const struct hlsl_type *t2)
{ {
if (t1->type != t2->type) if (t1->type != t2->type)
......
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