diff options
author | Matt Turner <[email protected]> | 2014-07-11 16:17:47 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2014-08-18 18:56:30 -0700 |
commit | d688667c7f8ab69b079b7c85dccc2b70e5863e32 (patch) | |
tree | 5a5f68d6d8801a00c390f0f93011ed58984cc026 /src | |
parent | 19c6617adfec618889bb52d5398b8ac3d5969c18 (diff) |
i965/cfg: Embed link in bblock_t for main block list.
The next patch adds a foreach_block (block, cfg) macro, which works
better if it provides a direct bblock_t pointer, rather than a
bblock_link pointer that you have to use to find the actual block.
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_cfg.cpp | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_cfg.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.cpp b/src/mesa/drivers/dri/i965/brw_cfg.cpp index 07111f5ac42..4a5c912daf8 100644 --- a/src/mesa/drivers/dri/i965/brw_cfg.cpp +++ b/src/mesa/drivers/dri/i965/brw_cfg.cpp @@ -67,8 +67,8 @@ bblock_t::bblock_t() : void bblock_t::add_successor(void *mem_ctx, bblock_t *successor) { - successor->parents.push_tail(link(mem_ctx, this)); - children.push_tail(link(mem_ctx, successor)); + successor->parents.push_tail(::link(mem_ctx, this)); + children.push_tail(::link(mem_ctx, successor)); } void @@ -285,7 +285,7 @@ cfg_t::set_next_block(bblock_t **cur, bblock_t *block, int ip) block->start_ip = ip; block->block_num = num_blocks++; - block_list.push_tail(link(mem_ctx, block)); + block_list.push_tail(&block->link); *cur = block; } @@ -295,8 +295,8 @@ cfg_t::make_block_array() blocks = ralloc_array(mem_ctx, bblock_t *, num_blocks); int i = 0; - foreach_list_typed(bblock_link, link, link, &block_list) { - blocks[i++] = link->block; + foreach_list_typed(bblock_t, block, link, &block_list) { + blocks[i++] = block; } assert(i == num_blocks); } diff --git a/src/mesa/drivers/dri/i965/brw_cfg.h b/src/mesa/drivers/dri/i965/brw_cfg.h index 01fcc1befdc..324df6caf6c 100644 --- a/src/mesa/drivers/dri/i965/brw_cfg.h +++ b/src/mesa/drivers/dri/i965/brw_cfg.h @@ -61,6 +61,8 @@ struct bblock_t { void dump(backend_visitor *v); #endif + struct exec_node link; + struct backend_instruction *start; struct backend_instruction *end; |