diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2010-11-11 12:21:27 -0800 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2010-11-30 13:48:28 -0800 |
commit | 01a25bb64ecae156729794320f9a39733ff8eeaa (patch) | |
tree | f8e30a2c03f2d63b48c50f52969c4a7cbbf440ba /src/glsl/ir_import_prototypes.cpp | |
parent | 4ce084c7072931732fba7ae1d73a4e4e20269f9d (diff) |
glsl: Refactor out cloning of function prototypes.
This allows us to reuse some code and will be useful later.
Diffstat (limited to 'src/glsl/ir_import_prototypes.cpp')
-rw-r--r-- | src/glsl/ir_import_prototypes.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
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<ir_variable *>(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); |