Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Basile STARYNKEVITCH
Taras wrote: I might be the only person out there who likes GTY annotations. The fact that gengtype has a separate parser is highly inconvenient. Why not use the GCC C/C++ parser on gengtype? It seems that with some refactoring, it should be possible to bootstrap just the C++ parser( without

Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Taras
Daniel Berlin wrote: Maybe at some point then we should just stop using gengtype and just hand-write the walkers once. One of the reasons gengtype exists is because you can't easily have an abstract interface with member functions that you can force people to implement in C. In C++, we can. Th

Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Taras
Daniel Berlin wrote: Maybe at some point then we should just stop using gengtype and just hand-write the walkers once. One of the reasons gengtype exists is because you can't easily have an abstract interface with member functions that you can force people to implement in C. In C++, we can. Th

Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Doug Gregor
On Wed, Jun 25, 2008 at 10:49 AM, Tom Tromey <[EMAIL PROTECTED]> wrote: >> "Daniel" == Daniel Jacobowitz <[EMAIL PROTECTED]> writes: > >>> On Wed, Jun 25, 2008 at 08:35:41AM -0600, Tom Tromey wrote: >>> I think most of the needed changes will be in gengtype. If you aren't >>> familiar with wha

Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Tom Tromey
> "Dan" == Daniel Berlin <[EMAIL PROTECTED]> writes: Dan> Maybe at some point then we should just stop using gengtype and just Dan> hand-write the walkers once. Yeah, we could do that for the containers. GTY markers serve three purposes though: they explain the meanings of fields (this part

Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Gabriel Dos Reis
On Wed, Jun 25, 2008 at 10:48 AM, Andrew Pinski <[EMAIL PROTECTED]> wrote: > On Wed, Jun 25, 2008 at 8:38 AM, Richard Guenther > <[EMAIL PROTECTED]> wrote: >> Hmmm, does C++0x add some type-reflection? ;) > > Yes but I don't see how we can use it in C++03/C++98 code. Compiling > GCC 4.5 (or 5.0) w

Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Andrew Pinski
On Wed, Jun 25, 2008 at 8:38 AM, Richard Guenther <[EMAIL PROTECTED]> wrote: > Hmmm, does C++0x add some type-reflection? ;) Yes but I don't see how we can use it in C++03/C++98 code. Compiling GCC 4.5 (or 5.0) with only 4.3 will be a pain. In fact C++0x has changed the definition of auto so you

Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Richard Guenther
On Wed, Jun 25, 2008 at 5:34 PM, Daniel Berlin <[EMAIL PROTECTED]> wrote: > Maybe at some point then we should just stop using gengtype and just > hand-write the walkers once. > > One of the reasons gengtype exists is because you can't easily have an > abstract interface with member functions that

Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Daniel Berlin
Maybe at some point then we should just stop using gengtype and just hand-write the walkers once. One of the reasons gengtype exists is because you can't easily have an abstract interface with member functions that you can force people to implement in C. In C++, we can. This is of course, a larg

Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Tom Tromey
> "Daniel" == Daniel Jacobowitz <[EMAIL PROTECTED]> writes: >> On Wed, Jun 25, 2008 at 08:35:41AM -0600, Tom Tromey wrote: >> I think most of the needed changes will be in gengtype. If you aren't >> familiar with what this does, read gcc/doc/gty.texi. Daniel> Also - I may regret saying this

Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Daniel Jacobowitz
On Wed, Jun 25, 2008 at 08:35:41AM -0600, Tom Tromey wrote: > I think most of the needed changes will be in gengtype. If you aren't > familiar with what this does, read gcc/doc/gty.texi. Also - I may regret saying this but - doesn't gengtype have a simplistic C parser in it? How upset is it like

Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Tom Tromey
> "Chris" == Chris Jefferson <[EMAIL PROTECTED]> writes: Chris> Could someone point me towards what is necessary to add STL Chris> containers to the garbage collector? I think most of the needed changes will be in gengtype. If you aren't familiar with what this does, read gcc/doc/gty.texi.

Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Gabriel Dos Reis
On Wed, Jun 25, 2008 at 9:04 AM, Basile STARYNKEVITCH <[EMAIL PROTECTED]> wrote: > Chris Jefferson wrote: >> >> Could someone point me towards what is necessary to add STL containers >> to the garbage collector? >> >> One big problem with garbage collecting in C++ is the need to run >> destructors.

Re: gcc-in-cxx: Garbage Collecting STL Containers

2008-06-25 Thread Basile STARYNKEVITCH
Chris Jefferson wrote: Could someone point me towards what is necessary to add STL containers to the garbage collector? One big problem with garbage collecting in C++ is the need to run destructors. If the (I believe very reasonable) decision is made to require that running destructors is not ne