From 7eba871a24b6e6fa5483531abaf8a1be8a88c0a4 Mon Sep 17 00:00:00 2001 From: Steven Bosscher Date: Fri, 30 Nov 2012 09:46:02 +0000 Subject: coretypes.h (struct pretty_print_info): Make a coretype. * coretypes.h (struct pretty_print_info): Make a coretype. (typedef pretty_printer): Likewise. * pretty-print.h (typedef pretty_printer): Not needed here anymore. * pretty-print.c (pp_write_text_as_dot_label_to_stream): New function. * rtl.h (str_pattern_slim): New prototype. (print_value, print_pattern, print_insn): Adjust prototypes to take a pretty-printer rather than a char buffer. * sched-vis.c (safe_concat): Remove. (print_exp): Print into a pretty-printer. (print_value): Likewise. (print_pattern): Likewise. (print_insn): Likewise. (print_insn_with_notes): New static function. (init_rtl_slim_pretty_print): New function. (dump_value_slim): Simplify. Print into and flush a pretty-printer. (dump_insn_slim): Likewise. (dump_rtl_slim): Likewise. (str_pattern_slim): New function. * haifa-sched.c (model_recompute): Use str_pattern_slim instead of static buffers. (model_record_pressures): Likewise. (schedule_insn): Likewise. * sel-sched-dump.c (dump_insn_rtx_1): Likewise. (sel_prepare_string_for_dot_label): Refer to graph.c CFG dumper code. * graph.c: Include pretty-print.h. (init_graph_slim_pretty_print): New function. (print_escaped_line): Removed here, and reincarnated as pp_write_text_as_dot_label_to_stream. (draw_cfg_node): Print into a pretty printer. (draw_cfg_node_succ_edges): Likewise. (print_rtl_graph_with_bb): Likewise. * Makefile.in (graph.o): Fix dependencies. (tree-optimize.o, toplev.o, sched-vis.o): Likewise. From-SVN: r193990 --- gcc/haifa-sched.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'gcc/haifa-sched.c') diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index c835bf8..ad7e08e 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -2168,8 +2168,6 @@ model_recompute (rtx insn) if (sched_verbose >= 5) { - char buf[2048]; - if (!print_p) { fprintf (sched_dump, MODEL_BAR); @@ -2179,9 +2177,9 @@ model_recompute (rtx insn) print_p = true; } - print_pattern (buf, PATTERN (insn), 0); fprintf (sched_dump, ";;\t\t| %3d %4d %-30s ", - point, INSN_UID (insn), buf); + point, INSN_UID (insn), + str_pattern_slim (PATTERN (insn))); for (pci = 0; pci < ira_pressure_classes_num; pci++) { cl = ira_pressure_classes[pci]; @@ -3343,18 +3341,16 @@ model_record_pressures (struct model_insn_info *insn) point = model_index (insn->insn); if (sched_verbose >= 2) { - char buf[2048]; - if (point == 0) { fprintf (sched_dump, "\n;;\tModel schedule:\n;;\n"); fprintf (sched_dump, ";;\t| idx insn | mpri hght dpth prio |\n"); } - print_pattern (buf, PATTERN (insn->insn), 0); fprintf (sched_dump, ";;\t| %3d %4d | %4d %4d %4d %4d | %-30s ", point, INSN_UID (insn->insn), insn->model_priority, insn->depth + insn->alap, insn->depth, - INSN_PRIORITY (insn->insn), buf); + INSN_PRIORITY (insn->insn), + str_pattern_slim (PATTERN (insn->insn))); } calculate_reg_deaths (insn->insn, death); reg_pressure = INSN_REG_PRESSURE (insn->insn); @@ -3715,12 +3711,9 @@ schedule_insn (rtx insn) if (sched_verbose >= 1) { struct reg_pressure_data *pressure_info; - char buf[2048]; - - print_insn (buf, insn, 0); - buf[40] = 0; fprintf (sched_dump, ";;\t%3i--> %s%-40s:", - clock_var, (*current_sched_info->print_insn) (insn, 1), buf); + clock_var, (*current_sched_info->print_insn) (insn, 1), + str_pattern_slim (PATTERN (insn))); if (recog_memoized (insn) < 0) fprintf (sched_dump, "nothing"); -- cgit v1.1