summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-07-10 17:30:40 -0700
committerMatt Turner <[email protected]>2014-08-18 19:05:59 -0700
commit26624b85e70cc4fdf77d7a4be15c154644db5894 (patch)
tree54de45a0ee855c4574ac395f434b42d6f2f41a44 /src/mesa
parentc51b0861e4559c13bee0d6fb0da2575b39e50e38 (diff)
i965/cfg: Add a foreach_inst_in_block_safe macro.
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_cfg.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.h b/src/mesa/drivers/dri/i965/brw_cfg.h
index a5d2df58fa4..913a1ed85de 100644
--- a/src/mesa/drivers/dri/i965/brw_cfg.h
+++ b/src/mesa/drivers/dri/i965/brw_cfg.h
@@ -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; \