i965/cfg: Allow cfg::dump to be called without a visitor.
authorMatt Turner <mattst88@gmail.com>
Wed, 19 Feb 2014 00:38:07 +0000 (16:38 -0800)
committerMatt Turner <mattst88@gmail.com>
Wed, 18 Feb 2015 04:44:09 +0000 (20:44 -0800)
The fs_visitor's dump_instruction() implementation calls cfg_t()
indirectly through calculate_live_intervals, so if you have an infinite
loop in the CFG code, you can't call cfg::dump(fs_visitor *) to debug
it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_cfg.cpp

index 62cc23970d6fb6fbc547c75b3cc2ef71b700481c..ca5b01cd03d8bccb76ad63e0cf4628c2f193e1ff 100644 (file)
@@ -418,7 +418,8 @@ cfg_t::dump(backend_visitor *v) const
                  link->block->num);
       }
       fprintf(stderr, "\n");
-      block->dump(v);
+      if (v != NULL)
+         block->dump(v);
       fprintf(stderr, "END B%d", block->num);
       foreach_list_typed(bblock_link, link, link, &block->children) {
          fprintf(stderr, " ->B%d",