This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH GCC][01/06]New interface returning all adjacent vertices in graph
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Bin Cheng <Bin dot Cheng at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Mon, 21 Aug 2017 15:03:37 +0200
- Subject: Re: [PATCH GCC][01/06]New interface returning all adjacent vertices in graph
- Authentication-results: sourceware.org; auth=none
- References: <DB5PR0801MB274208FA58DEBB80F2382EB0E78C0@DB5PR0801MB2742.eurprd08.prod.outlook.com>
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.