From 60e2d06d1ccc66ad00cd7ab81c418853f21be291 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 20 Jul 2010 11:27:38 -0700 Subject: glsl2: Implement utility routine to talloc reparent an IR tree --- src/mesa/shader/ir_to_mesa.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp index 1a9b0e3948..d1c09febd6 100644 --- a/src/mesa/shader/ir_to_mesa.cpp +++ b/src/mesa/shader/ir_to_mesa.cpp @@ -2146,12 +2146,6 @@ get_mesa_program(GLcontext *ctx, struct gl_shader_program *shader_program, extern "C" { -static void -steal_memory(ir_instruction *ir, void *new_ctx) -{ - talloc_steal(new_ctx, ir); -} - void _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader) { @@ -2215,9 +2209,7 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader) shader->Version = state->language_version; /* Retain any live IR, but trash the rest. */ - foreach_list(node, shader->ir) { - visit_tree((ir_instruction *) node, steal_memory, shader); - } + reparent_ir(shader->ir, shader); talloc_free(state); } -- cgit v1.2.3