[committed] analyzer: tweaks to superedge::dump

Message ID 20200327141420.31118-1-dmalcolm@redhat.com
State New
Headers show
Series
  • [committed] analyzer: tweaks to superedge::dump
Related show

Commit Message

Feng Xue OS via Gcc-patches March 27, 2020, 2:14 p.m.
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to master as 4d661bb7a2e1fdfd856140f1b86266ca524df9e2.

gcc/analyzer/ChangeLog:
	* supergraph.cc (superedge::dump): Add space before description;
	move newline to non-pretty_printer overload.
---
 gcc/analyzer/supergraph.cc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

-- 
2.21.0

Patch

diff --git a/gcc/analyzer/supergraph.cc b/gcc/analyzer/supergraph.cc
index e4c067606e0..4ed016e1898 100644
--- a/gcc/analyzer/supergraph.cc
+++ b/gcc/analyzer/supergraph.cc
@@ -630,8 +630,13 @@  void
 superedge::dump (pretty_printer *pp) const
 {
   pp_printf (pp, "edge: SN: %i -> SN: %i", m_src->m_index, m_dest->m_index);
-  dump_label_to_pp (pp, false);
-  pp_newline (pp);
+  char *desc = get_description (false);
+  if (strlen (desc) > 0)
+    {
+      pp_space (pp);
+      pp_string (pp, desc);
+    }
+  free (desc);
 }
 
 /* Dump this superedge to stderr.  */
@@ -644,6 +649,7 @@  superedge::dump () const
   pp_show_color (&pp) = pp_show_color (global_dc->printer);
   pp.buffer->stream = stderr;
   dump (&pp);
+  pp_newline (&pp);
   pp_flush (&pp);
 }