i965/cfg: Add a foreach_inst_in_block_safe macro.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
Matt Turner
2014-07-10 17:30:40 -07:00
parent c51b0861e4
commit 26624b85e7
+8
View File
@@ -120,6 +120,14 @@ struct cfg_t {
__inst != __block->end->next; \
__inst = (__type *)__inst->next)
#define foreach_inst_in_block_safe(__type, __inst, __block) \
for (__type *__inst = (__type *)__block->start, \
*__next = (__type *)__inst->next, \
*__end = (__type *)__block->end->next->next; \
__next != __end; \
__inst = __next, \
__next = (__type *)__next->next)
#define foreach_inst_in_block_reverse(__type, __inst, __block) \
for (__type *__inst = (__type *)__block->end; \
__inst != __block->start->prev; \