diff mbox series

graph output: use better colors for edges

Message ID f620bd28-cea4-7d39-772b-2949cff35571@suse.cz
State New
Headers show
Series graph output: use better colors for edges | expand

Commit Message

Martin Liška Sept. 1, 2021, 9:10 a.m. UTC
This patch improves coloring of graph dumps, as can be seen here:
https://splichal.eu/tmp/example.svg

Ready to be installed once it finishes tests?
Thanks,
Martin

gcc/ChangeLog:

	* graph.c (draw_cfg_node_succ_edges): Do not color fallthru
	  edges and rather use colors for TRUE and FALSE edges.
---
  gcc/graph.c | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Richard Biener Sept. 1, 2021, 11:20 a.m. UTC | #1
On Wed, Sep 1, 2021 at 11:10 AM Martin Liška <mliska@suse.cz> wrote:
>
> This patch improves coloring of graph dumps, as can be seen here:
> https://splichal.eu/tmp/example.svg
>
> Ready to be installed once it finishes tests?

OK

> Thanks,
> Martin
>
> gcc/ChangeLog:
>
>         * graph.c (draw_cfg_node_succ_edges): Do not color fallthru
>           edges and rather use colors for TRUE and FALSE edges.
> ---
>   gcc/graph.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/graph.c b/gcc/graph.c
> index ce8de33ffe1..9acd1d5b95e 100644
> --- a/gcc/graph.c
> +++ b/gcc/graph.c
> @@ -133,10 +133,11 @@ draw_cfg_node_succ_edges (pretty_printer *pp, int funcdef_no, basic_block bb)
>           weight = 10;
>         }
>         else if (e->flags & EDGE_FALLTHRU)
> -       {
> -         color = "blue";
> -         weight = 100;
> -       }
> +       weight = 100;
> +      else if (e->flags & EDGE_TRUE_VALUE)
> +       color = "forestgreen";
> +      else if (e->flags & EDGE_FALSE_VALUE)
> +       color = "darkorange";
>
>         if (e->flags & EDGE_ABNORMAL)
>         color = "red";
> --
> 2.33.0
>
diff mbox series

Patch

diff --git a/gcc/graph.c b/gcc/graph.c
index ce8de33ffe1..9acd1d5b95e 100644
--- a/gcc/graph.c
+++ b/gcc/graph.c
@@ -133,10 +133,11 @@  draw_cfg_node_succ_edges (pretty_printer *pp, int funcdef_no, basic_block bb)
  	  weight = 10;
  	}
        else if (e->flags & EDGE_FALLTHRU)
-	{
-	  color = "blue";
-	  weight = 100;
-	}
+	weight = 100;
+      else if (e->flags & EDGE_TRUE_VALUE)
+	color = "forestgreen";
+      else if (e->flags & EDGE_FALSE_VALUE)
+	color = "darkorange";
  
        if (e->flags & EDGE_ABNORMAL)
  	color = "red";