public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r15-104] Make graph dumps use graphviz format
@ 2024-05-02 7:01 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2024-05-02 7:01 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:c59708fba3f98a4cc257741b88216b6caf6b4a87
commit r15-104-gc59708fba3f98a4cc257741b88216b6caf6b4a87
Author: Richard Biener <rguenther@suse.de>
Date: Tue Apr 30 13:01:43 2024 +0200
Make graph dumps use graphviz format
SLP build eventually uses graphds graphs, the following makes its
dump use graphviz format so you can easily visualize it.
* graphds.cc (dump_graph): Dump in graphviz format.
Diff:
---
gcc/graphds.cc | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/gcc/graphds.cc b/gcc/graphds.cc
index 17d08966f53..ed5bfeb2808 100644
--- a/gcc/graphds.cc
+++ b/gcc/graphds.cc
@@ -31,22 +31,17 @@ dump_graph (FILE *f, struct graph *g)
int i;
struct graph_edge *e;
+ fprintf (f, "digraph {\n");
for (i = 0; i < g->n_vertices; i++)
{
- if (!g->vertices[i].pred
- && !g->vertices[i].succ)
- continue;
-
- fprintf (f, "%d (%d)\t<-", i, g->vertices[i].component);
+ fprintf (f, "\"%d\" [label=\"%d (%d): %p\"];\n",
+ i, i, g->vertices[i].component, g->vertices[i].data);
for (e = g->vertices[i].pred; e; e = e->pred_next)
- fprintf (f, " %d", e->src);
- fprintf (f, "\n");
-
- fprintf (f, "\t->");
+ fprintf (f, "\"%d\" -> \"%d\" [label=\"%p\"];\n", e->src, e->dest, e->data);
for (e = g->vertices[i].succ; e; e = e->succ_next)
- fprintf (f, " %d", e->dest);
- fprintf (f, "\n");
+ fprintf (f, "\"%d\" -> \"%d\";\n", e->src, e->dest);
}
+ fprintf (f, "}\n");
}
/* Creates a new graph with N_VERTICES vertices. */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-02 7:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-02 7:01 [gcc r15-104] Make graph dumps use graphviz format Richard Biener
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).