Re: [patch] Apply conditional down cast to cgraph.h et.al.

2012-11-05 Thread Eric Botcazou
> Done and committed. That's great, thanks! -- Eric Botcazou

Re: [patch] Apply conditional down cast to cgraph.h et.al.

2012-11-02 Thread Lawrence Crowl
On 11/2/12, Eric Botcazou wrote: >> Index: gcc/ChangeLog >> >> 2012-10-31 Lawrence Crowl >> >> * is-a.h: New. >> (is_a (U*)): New. Test for is-a relationship. >> (as_a (U*)): New. Treat as a derived type. >> (dyn_cast (U*)): New. Conditionally cast based on is_a. >>

Re: [patch] Apply conditional down cast to cgraph.h et.al.

2012-11-02 Thread Eric Botcazou
> Index: gcc/ChangeLog > > 2012-10-31 Lawrence Crowl > > * is-a.h: New. > (is_a (U*)): New. Test for is-a relationship. > (as_a (U*)): New. Treat as a derived type. > (dyn_cast (U*)): New. Conditionally cast based on is_a. > * cgraph.h (varpool_node): Rename

Re: [patch] Apply conditional down cast to cgraph.h et.al.

2012-10-30 Thread Xinliang David Li
Good cleanup! Simple and consistent interfaces are usually self-documenting, and this one is a good step forward. thanks, David On Tue, Oct 30, 2012 at 2:09 PM, Lawrence Crowl wrote: > On 10/30/12, Diego Novillo wrote: >> On Tue, Oct 30, 2012 at 4:53 PM, Lawrence Crowl wrote: >>> On 10/30/12,

Re: [patch] Apply conditional down cast to cgraph.h et.al.

2012-10-30 Thread Lawrence Crowl
On 10/30/12, Diego Novillo wrote: > On Tue, Oct 30, 2012 at 4:53 PM, Lawrence Crowl wrote: >> On 10/30/12, Diego Novillo wrote: >>> >>> So, to use these three functions, the user must define this single >>> 'is_a_helper' routine? Nothing else? >> >> You need to distinguish which kind user. Som

Re: [patch] Apply conditional down cast to cgraph.h et.al.

2012-10-30 Thread Diego Novillo
On Tue, Oct 30, 2012 at 4:53 PM, Lawrence Crowl wrote: > On 10/30/12, Diego Novillo wrote: >> >> So, to use these three functions, the user must define this single >> 'is_a_helper' routine? Nothing else? > > You need to distinguish which kind user. Someone just wanting > to convert does not nee

Re: [patch] Apply conditional down cast to cgraph.h et.al.

2012-10-30 Thread Lawrence Crowl
On 10/30/12, Diego Novillo wrote: > On 2012-10-29 15:01 , Lawrence Crowl wrote: >> On 10/27/12, Marc Glisse wrote: >>> On Fri, 26 Oct 2012, Lawrence Crowl wrote: 2012-10-26 Lawrence Crowl >> >>> missing '>' >> >> Fixed. >> * is-a.h: New. (is_a (U*)): New. Test for is-a re

Re: [patch] Apply conditional down cast to cgraph.h et.al.

2012-10-30 Thread Jan Hubicka
> 2012-10-29 Lawrence Crowl > > * is-a.h: New. > (is_a (U*)): New. Test for is-a relationship. > (as_a (U*)): New. Treat as a derived type. > (dyn_cast (U*)): New. Conditionally cast based on is_a. > * cgraph.h (varpool_node): Rename to varpool_node_for_decl.

Re: [patch] Apply conditional down cast to cgraph.h et.al.

2012-10-30 Thread Richard Biener
On Tue, Oct 30, 2012 at 1:20 PM, Diego Novillo wrote: > On 2012-10-29 15:01 , Lawrence Crowl wrote: >> >> On 10/27/12, Marc Glisse wrote: >>> >>> On Fri, 26 Oct 2012, Lawrence Crowl wrote: 2012-10-26 Lawrence Crowl >> >>> >>> missing '>' >> >> >> Fixed. >> * is-a.h: New.

Re: [patch] Apply conditional down cast to cgraph.h et.al.

2012-10-30 Thread Diego Novillo
On 2012-10-29 15:01 , Lawrence Crowl wrote: On 10/27/12, Marc Glisse wrote: On Fri, 26 Oct 2012, Lawrence Crowl wrote: 2012-10-26 Lawrence Crowl missing '>' Fixed. * is-a.h: New. (is_a (U*)): New. Test for is-a relationship. (as_a (U*)): New. Treat as a deri

Re: [patch] Apply conditional down cast to cgraph.h et.al.

2012-10-29 Thread Lawrence Crowl
On 10/27/12, Marc Glisse wrote: > On Fri, 26 Oct 2012, Lawrence Crowl wrote: > > 2012-10-26 Lawrence Crowl > missing '>' Fixed. > > * is-a.h: New. > > (is_a (U*)): New. Test for is-a relationship. > > (as_a (U*)): New. Treat as a derived type. > > (dyn_cast (U*)): New. C

[patch] Apply conditional down cast to cgraph.h et.al.

2012-10-26 Thread Lawrence Crowl
This patch implements generic type query and conversion functions, and applies them to the use of cgraph_node, varpool_node, and symtab_node. The functions are: bool is_a (pointer) Tests whether the pointer actually points to a more derived TYPE. TYPE *as_a (pointer) Converts pointer to a