Add an option to control expr tree dumping.

About bloody time :P
This commit is contained in:
Bill Currie 2012-11-26 21:00:28 +09:00
parent e28aa0a5fb
commit d6b38dd0ee
4 changed files with 7 additions and 3 deletions

View file

@ -73,6 +73,7 @@ typedef struct {
qboolean dead;
qboolean final;
qboolean dags;
qboolean expr;
qboolean flow;
qboolean post;
} blockdot_options_t;

View file

@ -175,7 +175,7 @@ print_bool (dstring_t *dstr, expr_t *e, int level, int id, expr_t *next)
dasprintf (dstr, "%*s<tr>%s<td port=\"f%d\">f</td></tr>\n",
indent, "",
i == count ? va ("<td rowspan=\"%d\"></td>",
bool->true_list->size - count)
bool->false_list->size - count)
: "",
i);
dasprintf (dstr, "%*s</table>\n", indent + 2, "");

View file

@ -391,6 +391,8 @@ DecodeArgs (int argc, char **argv)
options.block_dot.final = flag;
} else if (!(strcasecmp (temp, "dags"))) {
options.block_dot.dags = flag;
} else if (!(strcasecmp (temp, "expr"))) {
options.block_dot.expr = flag;
} else if (!(strcasecmp (temp, "flow"))) {
options.block_dot.flow = flag;
} else if (!(strcasecmp (temp, "post"))) {
@ -405,6 +407,7 @@ DecodeArgs (int argc, char **argv)
options.block_dot.dead = true;
options.block_dot.final = true;
options.block_dot.dags = true;
options.block_dot.expr = true;
options.block_dot.flow = true;
options.block_dot.post = true;
}

View file

@ -1442,8 +1442,8 @@ sblock_t *
make_statements (expr_t *e)
{
sblock_t *sblock = new_sblock ();
//sblock_t *s;
//dump_dot ("expr", e, dump_dot_expr);
if (options.block_dot.expr)
dump_dot ("expr", e, dump_dot_expr);
statement_slist (sblock, e);
if (options.block_dot.initial)
dump_dot ("initial", sblock, dump_dot_sblock);