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/glsl/main.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/glsl/main.cpp') diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp index 6b1a01c704..cf9a515785 100644 --- a/src/glsl/main.cpp +++ b/src/glsl/main.cpp @@ -118,12 +118,6 @@ const struct option compiler_opts[] = { { NULL, 0, NULL, 0 } }; -static void -steal_memory(ir_instruction *ir, void *new_ctx) -{ - talloc_steal(new_ctx, ir); -} - void compile_shader(struct gl_shader *shader) { @@ -232,9 +226,7 @@ compile_shader(struct gl_shader *shader) shader->InfoLog = state->info_log; /* 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