diff --git a/tools/qfcc/include/statements.h b/tools/qfcc/include/statements.h index d7edaa4d5..4a23861ec 100644 --- a/tools/qfcc/include/statements.h +++ b/tools/qfcc/include/statements.h @@ -86,6 +86,7 @@ struct expr_s; sblock_t *make_statements (struct expr_s *expr); void print_statement (statement_t *s); void print_sblock (sblock_t *sblock, const char *filename); +void dump_sblock (sblock_t *sblock, const char *stage); const char *operand_string (operand_t *op); #endif//statement_h diff --git a/tools/qfcc/source/dot_sblock.c b/tools/qfcc/source/dot_sblock.c index 22e1c8e60..1eb137505 100644 --- a/tools/qfcc/source/dot_sblock.c +++ b/tools/qfcc/source/dot_sblock.c @@ -46,6 +46,8 @@ #include "dags.h" #include "flow.h" #include "expr.h" +#include "qfcc.h" +#include "function.h" #include "statements.h" #include "strpool.h" #include "symtab.h" @@ -130,3 +132,14 @@ print_sblock (sblock_t *sblock, const char *filename) } dstring_delete (dstr); } + +void +dump_sblock (sblock_t *sblock, const char *stage) +{ + char *fname; + + fname = nva ("%s.%s.%s.dot", GETSTR (pr.source_file), current_func->name, + stage); + print_sblock (sblock, fname); + free (fname); +} diff --git a/tools/qfcc/source/statements.c b/tools/qfcc/source/statements.c index ba3bf1f67..ead0eeac2 100644 --- a/tools/qfcc/source/statements.c +++ b/tools/qfcc/source/statements.c @@ -1170,17 +1170,6 @@ unuse_label (ex_label_t *label) remove_label_from_dest (label); } -static void -dump_flow (sblock_t *sblock, const char *stage) -{ - char *fname; - - fname = nva ("%s.%s.%s.dot", GETSTR (pr.source_file), current_func->name, - stage); - print_sblock (sblock, fname); - free (fname); -} - static void thread_jumps (sblock_t *blocks) { @@ -1401,22 +1390,22 @@ make_statements (expr_t *e) // print_expr (e); statement_slist (sblock, e); if (options.block_dot.initial) - dump_flow (sblock, "initial"); + dump_sblock (sblock, "initial"); thread_jumps (sblock); if (options.block_dot.thread) - dump_flow (sblock, "thread"); + dump_sblock (sblock, "thread"); do { remove_dead_blocks (sblock); } while (merge_blocks (sblock)); if (options.block_dot.dead) - dump_flow (sblock, "dead"); + dump_sblock (sblock, "dead"); check_final_block (sblock); if (options.block_dot.final) - dump_flow (sblock, "final"); + dump_sblock (sblock, "final"); //for (s = sblock; s; s = s->next) // s->dag = make_dag (s); //if (options.block_dot.dags) - // dump_flow (sblock, "dags"); + // dump_sblock (sblock, "dags"); return sblock; }