i965/cfg: Add a foreach_block_and_inst macro.
authorMatt Turner <mattst88@gmail.com>
Sat, 12 Jul 2014 04:17:01 +0000 (21:17 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 21 Jul 2014 17:35:38 +0000 (10:35 -0700)
Will let us abstract how the instructions are stored.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/brw_cfg.h

index cdbadde..01fcc1b 100644 (file)
@@ -103,6 +103,10 @@ struct cfg_t {
    int num_blocks;
 };
 
+#define foreach_block_and_inst(__block, __type, __inst, __cfg) \
+   foreach_block (__block, __cfg)                              \
+      foreach_inst_in_block (__type, __inst, __block)
+
 #define foreach_inst_in_block(__type, __inst, __block)         \
    for (__type *__inst = (__type *)__block->start;             \
         __inst != __block->end->next;                          \