Matteo Bruni : d3dcompiler: add_func_parameter is only used in hlsl.y.

Alexandre Julliard julliard at winehq.org
Fri May 2 11:50:38 CDT 2014


Module: wine
Branch: master
Commit: c37714342ec3339c97338416e67b9fe324173bd6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c37714342ec3339c97338416e67b9fe324173bd6

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Fri May  2 16:30:14 2014 +0200

d3dcompiler: add_func_parameter is only used in hlsl.y.

---

 dlls/d3dcompiler_43/d3dcompiler_private.h |    2 --
 dlls/d3dcompiler_43/hlsl.y                |   25 +++++++++++++++++++++++++
 dlls/d3dcompiler_43/utils.c               |   25 -------------------------
 3 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h
index f7403f5..eb81ea5 100644
--- a/dlls/d3dcompiler_43/d3dcompiler_private.h
+++ b/dlls/d3dcompiler_43/d3dcompiler_private.h
@@ -1106,8 +1106,6 @@ static inline struct hlsl_ir_loop *loop_from_node(const struct hlsl_ir_node *nod
 BOOL add_declaration(struct hlsl_scope *scope, struct hlsl_ir_var *decl, BOOL local_var) DECLSPEC_HIDDEN;
 struct hlsl_ir_var *get_variable(struct hlsl_scope *scope, const char *name) DECLSPEC_HIDDEN;
 void free_declaration(struct hlsl_ir_var *decl) DECLSPEC_HIDDEN;
-BOOL add_func_parameter(struct list *list, struct parse_parameter *param,
-        const struct source_location *loc) DECLSPEC_HIDDEN;
 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) DECLSPEC_HIDDEN;
 struct hlsl_type *new_array_type(struct hlsl_type *basic_type, unsigned int array_size) DECLSPEC_HIDDEN;
diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y
index 9f2daba..f37e07e 100644
--- a/dlls/d3dcompiler_43/hlsl.y
+++ b/dlls/d3dcompiler_43/hlsl.y
@@ -808,6 +808,31 @@ static BOOL add_typedef(DWORD modifiers, struct hlsl_type *orig_type, struct lis
     return TRUE;
 }
 
+static 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;
+}
+
 static const struct hlsl_ir_function_decl *get_overloaded_func(struct wine_rb_tree *funcs, char *name,
         struct list *params, BOOL exact_signature)
 {
diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c
index c110718..858277a 100644
--- a/dlls/d3dcompiler_43/utils.c
+++ b/dlls/d3dcompiler_43/utils.c
@@ -805,31 +805,6 @@ void free_declaration(struct hlsl_ir_var *decl)
     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)
 {




More information about the wine-cvs mailing list