[PATCH GCC][01/06]New interface returning all adjacent vertices in graph

Richard Biener richard.guenther@gmail.com
Mon Aug 21 13:31:00 GMT 2017


On Mon, Aug 14, 2017 at 11:19 AM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> Hi,
> This simple patch adds new interface returning adjacent vertices for a vertex in graph.
> Bootstrap and test in series.  Is it OK?

The comment of the function doesn't match its implementation.  Why did
you choose
to use the dfs helpers instead of (more clearly IMHO) using

 e = v->succ;
 while (e)
   {
     adj->safe_push (e->dest);
     e = e->succ_next;

given you do not expose the direction as arggument to adjacent_vertices?  Btw,
is this "adjacent" a term understood in the context of (directed) graphs?

Richard.

> Thanks,
> bin
> 2017-08-10  Bin Cheng  <bin.cheng@arm.com>
>
>         * graphds.c (adjacent_vertices): New function.
>         * graphds.h (adjacent_vertices): New declaration.



More information about the Gcc-patches mailing list