mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
i965/cfg: Add function to generate a dot file of the CFG.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
0e3dbc0248
commit
b06eef05d0
2 changed files with 15 additions and 0 deletions
|
|
@ -495,3 +495,17 @@ cfg_t::intersect(bblock_t *b1, bblock_t *b2)
|
|||
assert(b1);
|
||||
return b1;
|
||||
}
|
||||
|
||||
void
|
||||
cfg_t::dump_cfg()
|
||||
{
|
||||
printf("digraph CFG {\n");
|
||||
for (int b = 0; b < num_blocks; b++) {
|
||||
bblock_t *block = this->blocks[b];
|
||||
|
||||
foreach_list_typed_safe (bblock_link, child, link, &block->children) {
|
||||
printf("\t%d -> %d\n", b, child->block->num);
|
||||
}
|
||||
}
|
||||
printf("}\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,6 +274,7 @@ struct cfg_t {
|
|||
static bblock_t *intersect(bblock_t *b1, bblock_t *b2);
|
||||
|
||||
void dump(backend_visitor *v);
|
||||
void dump_cfg();
|
||||
#endif
|
||||
void *mem_ctx;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue