d3dcompiler_free(decl);
}
-BOOL add_func_parameter(struct list *list, struct parse_parameter *param, const struct source_location *loc)
-{
- struct hlsl_ir_var *decl = d3dcompiler_alloc(sizeof(*decl));
-
- if (!decl)
- {
- ERR("Out of memory.\n");
- return FALSE;
- }
- decl->node.type = HLSL_IR_VAR;
- decl->node.data_type = param->type;
- decl->node.loc = *loc;
- decl->name = param->name;
- decl->semantic = param->semantic;
- decl->modifiers = param->modifiers;
-
- if (!add_declaration(hlsl_ctx.cur_scope, decl, FALSE))
- {
- free_declaration(decl);
- return FALSE;
- }
- list_add_tail(list, &decl->node.entry);
- return TRUE;
-}
-
struct hlsl_type *new_hlsl_type(const char *name, enum hlsl_type_class type_class,
enum hlsl_base_type base_type, unsigned dimx, unsigned dimy)
{
static const char *debug_node_type(enum hlsl_ir_node_type type)
{
- const char *names[] =
+ static const char * const names[] =
{
"HLSL_IR_VAR",
"HLSL_IR_ASSIGNMENT",
static const char *debug_expr_op(const struct hlsl_ir_expr *expr)
{
- static const char *op_names[] =
+ static const char * const op_names[] =
{
"~",
"!",