From 01a25bb64ecae156729794320f9a39733ff8eeaa Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 11 Nov 2010 12:21:27 -0800 Subject: glsl: Refactor out cloning of function prototypes. This allows us to reuse some code and will be useful later. --- src/glsl/ir_import_prototypes.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'src/glsl/ir_import_prototypes.cpp') diff --git a/src/glsl/ir_import_prototypes.cpp b/src/glsl/ir_import_prototypes.cpp index 2bdc8d9fd7..4e0b30aa90 100644 --- a/src/glsl/ir_import_prototypes.cpp +++ b/src/glsl/ir_import_prototypes.cpp @@ -82,22 +82,7 @@ public: { assert(this->function != NULL); - ir_function_signature *copy = - new(mem_ctx) ir_function_signature(ir->return_type); - - copy->is_defined = false; - copy->is_builtin = ir->is_builtin; - - /* Clone the parameter list, but NOT the body. - */ - foreach_list_const(node, &ir->parameters) { - const ir_variable *const param = (const ir_variable *) node; - - assert(const_cast(param)->as_variable() != NULL); - - ir_variable *const param_copy = param->clone(mem_ctx, NULL); - copy->parameters.push_tail(param_copy); - } + ir_function_signature *copy = ir->clone_prototype(mem_ctx, NULL); this->function->add_signature(copy); -- cgit v1.2.3