From 2c895bd193cceed49da1d4a876459178dcc0a4b8 Mon Sep 17 00:00:00 2001 From: Steven Bosscher Date: Tue, 4 Dec 2012 18:38:26 +0000 Subject: rtl.h (print_insn_with_notes): Remove prototype. * rtl.h (print_insn_with_notes): Remove prototype. (rtl_dump_bb_for_graph): New prototype. * sched-vis.c (print_insn_with_notes): Make static again. Fix printing of notes. (rtl_dump_bb_for_graph): New function. * cfghooks.h (struct cfg_hooks) : New hook. (dump_bb_for_graph): New prototype. * cfghooks.c (dump_bb_for_graph): New function. * tree-cfg.c (gimple_cfg_hooks): Register gimple_dump_bb_for_graph as dump_bb_for_graph hook implementation for GIMPLE. * cfgrtl.c (rtl_cfg_hooks): Likewise for rtl_dump_bb_for_graph. (cfg_layout_rtl_cfg_hooks): Likewise. * graph.c (draw_cfg_node): Don't include sbitmap.h, rtl.h, tree.h, gimple.h, and gimple-pretty-print.h. (draw_cfg_node, draw_cfg_node_succ_edges): Use the uniqe function definition number instead of the function declaration UID. (print_graph_cfg): Take a struct function instead of a tree. Use the dump_bb_for_graph hook to dump the basic block content. * graph.h (print_graph_cfg): Update prototype. * passes.c (execute_function_dump): Update print_graph_cfg call. * Makefile.in (graph.o): Fixup dependencies. From-SVN: r194157 --- gcc/sched-vis.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'gcc/sched-vis.c') diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c index 90b75f1..bdb166e 100644 --- a/gcc/sched-vis.c +++ b/gcc/sched-vis.c @@ -716,10 +716,10 @@ print_insn (pretty_printer *pp, const_rtx x, int verbose) } } /* print_insn */ -/* Prerry-print a slim dump of X (an insn) to PP, including any register +/* Pretty-print a slim dump of X (an insn) to PP, including any register note attached to the instruction. */ -void +static void print_insn_with_notes (pretty_printer *pp, const_rtx x) { pp_string (pp, print_rtx_head); @@ -728,9 +728,9 @@ print_insn_with_notes (pretty_printer *pp, const_rtx x) if (INSN_P (x) && REG_NOTES (x)) for (rtx note = REG_NOTES (x); note; note = XEXP (note, 1)) { - pp_printf (pp, "%s %s", print_rtx_head, + pp_printf (pp, "%s %s ", print_rtx_head, GET_REG_NOTE_NAME (REG_NOTE_KIND (note))); - print_pattern (pp, XEXP (note, 0), 1); + print_pattern (pp, XEXP (note, 0), 1); pp_newline (pp); } } @@ -800,6 +800,29 @@ dump_rtl_slim (FILE *f, const_rtx first, const_rtx last, pp_flush (pp); } +/* Dumps basic block BB to pretty-printer PP in slim form and without and + no indentation, for use as a label of a DOT graph record-node. */ + +void +rtl_dump_bb_for_graph (pretty_printer *pp, basic_block bb) +{ + rtx insn; + bool first = true; + + /* TODO: inter-bb stuff. */ + FOR_BB_INSNS (bb, insn) + { + if (! first) + { + pp_character (pp, '|'); + pp_write_text_to_stream (pp); + } + first = false; + print_insn_with_notes (pp, insn); + pp_write_text_as_dot_label_to_stream (pp, /*for_record=*/true); + } +} + /* Pretty-print pattern X of some insn in non-verbose mode. Return a string pointer to the pretty-printer buffer. -- cgit v1.1