i965/cfg: Add macros to iterate through a block given a starting point.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
Matt Turner
2014-09-01 20:01:50 -07:00
parent 235f451f7a
commit 7119712f45
+10
View File
@@ -142,4 +142,14 @@ struct cfg_t {
__inst != __block->start->prev; \
__inst = (__type *)__inst->prev)
#define foreach_inst_in_block_starting_from(__type, __scan_inst, __inst, __block) \
for (__type *__scan_inst = (__type *)__inst->next; \
__scan_inst != __block->end->next; \
__scan_inst = (__type *)__scan_inst->next)
#define foreach_inst_in_block_reverse_starting_from(__type, __scan_inst, __inst, __block) \
for (__type *__scan_inst = (__type *)__inst->prev; \
__scan_inst != __block->start->prev; \
__scan_inst = (__type *)__scan_inst->prev)
#endif /* BRW_CFG_H */