nir: Allocate predecessor and dominance frontier sets from block itself.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 28 Mar 2015 04:29:07 +0000 (21:29 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 2 Apr 2015 21:20:02 +0000 (14:20 -0700)
These sets are part of the block, and their lifetime needs to match the
block itself.  So, allocate them using the block itself as the context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/glsl/nir/nir.c

index e96f113f2b2636a5f4e3b5a054656a918f6d2b31..73d3008a0b330514538f27effd44b2a0a64b0f8d 100644 (file)
@@ -285,10 +285,10 @@ nir_block_create(void *mem_ctx)
    cf_init(&block->cf_node, nir_cf_node_block);
 
    block->successors[0] = block->successors[1] = NULL;
-   block->predecessors = _mesa_set_create(mem_ctx, _mesa_hash_pointer,
+   block->predecessors = _mesa_set_create(block, _mesa_hash_pointer,
                                           _mesa_key_pointer_equal);
    block->imm_dom = NULL;
-   block->dom_frontier = _mesa_set_create(mem_ctx, _mesa_hash_pointer,
+   block->dom_frontier = _mesa_set_create(block, _mesa_hash_pointer,
                                           _mesa_key_pointer_equal);
 
    exec_list_make_empty(&block->instr_list);