public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-3452] Add cgraph_edge::debug function.
@ 2020-09-25  8:13 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2020-09-25  8:13 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b2784a9698ffdd6cd8434694c11336e9f7905be5

commit r11-3452-gb2784a9698ffdd6cd8434694c11336e9f7905be5
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Sep 24 16:29:49 2020 +0200

    Add cgraph_edge::debug function.
    
    gcc/ChangeLog:
    
            * cgraph.c (cgraph_edge::debug): New.
            * cgraph.h (cgraph_edge::debug): New.

Diff:
---
 gcc/cgraph.c | 14 ++++++++++++++
 gcc/cgraph.h |  3 +++
 2 files changed, 17 insertions(+)

diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index eb5f1a56c26..f018020fa4b 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2072,6 +2072,20 @@ cgraph_edge::dump_edge_flags (FILE *f)
     fprintf (f, "(can throw external) ");
 }
 
+/* Dump edge to stderr.  */
+
+void
+cgraph_edge::debug (void)
+{
+  fprintf (stderr, "%s -> %s ", caller->dump_asm_name (),
+	   callee == NULL ? "(null)" : callee->dump_asm_name ());
+  dump_edge_flags (stderr);
+  fprintf (stderr, "\n\n");
+  caller->debug ();
+  if (callee != NULL)
+    callee->debug ();
+}
+
 /* Dump call graph node to file F.  */
 
 void
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 0211f08964f..96d6cf609fe 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -2022,6 +2022,9 @@ private:
   /* Output flags of edge to a file F.  */
   void dump_edge_flags (FILE *f);
 
+  /* Dump edge to stderr.  */
+  void DEBUG_FUNCTION debug (void);
+
   /* Verify that call graph edge corresponds to DECL from the associated
      statement.  Return true if the verification should fail.  */
   bool verify_corresponds_to_fndecl (tree decl);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-25  8:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25  8:13 [gcc r11-3452] Add cgraph_edge::debug function Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).