mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-19 07:20:50 +00:00
Cope with empty sblocks when producing dot graphs.
This commit is contained in:
parent
2c09464e80
commit
c759b73b24
1 changed files with 16 additions and 9 deletions
|
@ -94,15 +94,22 @@ flow_sblock (dstring_t *dstr, sblock_t *sblock, int blockno)
|
|||
dasprintf (dstr, " <td></td>\n");
|
||||
dasprintf (dstr, " </tr>\n");
|
||||
dasprintf (dstr, " </table>>];\n");
|
||||
if (sblock->next && !flow_is_goto ((statement_t *) sblock->tail)
|
||||
&& !flow_is_jumpb ((statement_t *) sblock->tail)
|
||||
&& !flow_is_return ((statement_t *) sblock->tail))
|
||||
dasprintf (dstr, " sb_%p:e -> sb_%p:s;\n", sblock, sblock->next);
|
||||
if ((target_list = flow_get_targetlist ((statement_t *) sblock->tail))) {
|
||||
for (target = target_list; *target; target++)
|
||||
dasprintf (dstr, " sb_%p:e -> sb_%p:s [label=\"%s\"];\n", sblock,
|
||||
*target, ((statement_t *) sblock->tail)->opcode);
|
||||
free (target_list);
|
||||
if (sblock->statements) {
|
||||
statement_t *st = (statement_t *) sblock->tail;
|
||||
if (sblock->next
|
||||
&& !flow_is_goto (st)
|
||||
&& !flow_is_jumpb (st)
|
||||
&& !flow_is_return (st))
|
||||
dasprintf (dstr, " sb_%p:e -> sb_%p:s;\n", sblock, sblock->next);
|
||||
if ((target_list = flow_get_targetlist (st))) {
|
||||
for (target = target_list; *target; target++)
|
||||
dasprintf (dstr, " sb_%p:e -> sb_%p:s [label=\"%s\"];\n",
|
||||
sblock, *target, st->opcode);
|
||||
free (target_list);
|
||||
}
|
||||
} else {
|
||||
if (sblock->next)
|
||||
dasprintf (dstr, " sb_%p:e -> sb_%p:s;\n", sblock, sblock->next);
|
||||
}
|
||||
dasprintf (dstr, "\n");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue