aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-09-24 16:29:49 +0200
committerMartin Liska <mliska@suse.cz>2020-09-25 10:13:13 +0200
commitb2784a9698ffdd6cd8434694c11336e9f7905be5 (patch)
treec317f457ebd1b09ca5093bd7fd41d13aed3f76c0 /gcc
parente9e2953ceddb804e551d75725f4f603aaf71cc0f (diff)
downloadgcc-b2784a9698ffdd6cd8434694c11336e9f7905be5.zip
gcc-b2784a9698ffdd6cd8434694c11336e9f7905be5.tar.gz
gcc-b2784a9698ffdd6cd8434694c11336e9f7905be5.tar.bz2
Add cgraph_edge::debug function.
gcc/ChangeLog: * cgraph.c (cgraph_edge::debug): New. * cgraph.h (cgraph_edge::debug): New.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cgraph.c14
-rw-r--r--gcc/cgraph.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index eb5f1a5..f018020 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 0211f08..96d6cf6 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);