Re: Thoughts on Gengtype and Single Inheritance

2012-09-04 Thread Lawrence Crowl
On 9/3/12, Richard Guenther wrote: > On Aug 24, 2012, Lawrence Crowl wrote: > > To take full advantage of the conversion to C++, we will need to use > > I'm not sure what "full advantage" of single-inheritance vs. composition > is. You get automatic pointer-to-base-class conversion with single i

Re: Thoughts on Gengtype and Single Inheritance

2012-09-04 Thread Lawrence Crowl
On 8/31/12, Laurynas Biveinis wrote: GRAMMAR Support adding a second discriminator. This support is not for multiple inheritance, but for single inheritance when a second discriminator is used to further refine it. Look at struct tree_omp_clause. It contains a sub

Re: Thoughts on Gengtype and Single Inheritance

2012-09-03 Thread Richard Guenther
On Fri, Aug 24, 2012 at 10:06 PM, Lawrence Crowl wrote: > To take full advantage of the conversion to C++, we will need to use I'm not sure what "full advantage" of single-inheritance vs. composition is. > single inheritance in some of our garbage collected structures. To > that end, we need to

Re: Thoughts on Gengtype and Single Inheritance

2012-08-31 Thread Laurynas Biveinis
>>> GRAMMAR >>> >>> Support adding a second discriminator. This support is not for >>> multiple inheritance, but for single inheritance when a second >>> discriminator is used to further refine it. Look at struct >>> tree_omp_clause. It contains a sub union. We can represent the >>> hierarchy l

Re: Thoughts on Gengtype and Single Inheritance

2012-08-30 Thread Lawrence Crowl
On 8/30/12, Gabriel Dos Reis wrote: > On Aug 30, 2012 Richard Henderson wrote: > > On 08/27/2012 11:58 AM, Lawrence Crowl wrote: > > > > > I wonder if the second discriminator support is easily > > > > > generalizable to enabling any derived class being a root > > > > > class on it own with its o

Re: Thoughts on Gengtype and Single Inheritance

2012-08-30 Thread Lawrence Crowl
On 8/30/12, Richard Henderson wrote: > On 08/27/2012 11:58 AM, Lawrence Crowl wrote: >>> I wonder if the second discriminator support is easily generalizable >>> to enabling any derived class being a root class on it own with its >>> own subtree? If I understand correctly, the GTY syntax would be

Re: Thoughts on Gengtype and Single Inheritance

2012-08-30 Thread Gabriel Dos Reis
On Thu, Aug 30, 2012 at 11:57 AM, Richard Henderson wrote: > On 08/27/2012 11:58 AM, Lawrence Crowl wrote: >>> > I wonder if the second discriminator support is easily generalizable >>> > to enabling any derived class being a root class on it own with its >>> > own subtree? If I understand correct

Re: Thoughts on Gengtype and Single Inheritance

2012-08-30 Thread Richard Henderson
On 08/27/2012 11:58 AM, Lawrence Crowl wrote: >> > I wonder if the second discriminator support is easily generalizable >> > to enabling any derived class being a root class on it own with its >> > own subtree? If I understand correctly, the GTY syntax would be the >> > same. > If I understand corr

Re: Thoughts on Gengtype and Single Inheritance

2012-08-27 Thread Lawrence Crowl
On 8/27/12, Laurynas Biveinis wrote: > I don't have an opinion from the rest of compiler point of view, but > gengtype implementation-wise, it certainly looks doable. One minor > comment below - > >> GRAMMAR >> >> Support adding a second discriminator. This support is not for >> multiple inherita

Re: Thoughts on Gengtype and Single Inheritance

2012-08-27 Thread Laurynas Biveinis
Lawrence - I don't have an opinion from the rest of compiler point of view, but gengtype implementation-wise, it certainly looks doable. One minor comment below - > GRAMMAR > > Support adding a second discriminator. This support is not for > multiple inheritance, but for single inheritance when

Thoughts on Gengtype and Single Inheritance

2012-08-24 Thread Lawrence Crowl
To take full advantage of the conversion to C++, we will need to use single inheritance in some of our garbage collected structures. To that end, we need to make gengtype understand single inheritance. Here are my thoughts on how to make that happen. There are two major sections, one for non-poly