This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Partly rewriting gengtype in C++ ?

On Fri, 2 Mar 2012 19:56:19 +0200
Laurynas Biveinis <> wrote:

> Basile -
> > I'm quite tempted to start working on a rewrite of gengtype in C++ (using
> > C++03 standard).
> >
> > One of the reasons is that gengtype is really in bad shape, and nobody
> > understands it well. Another reason is that gengtype needs to be enhanced to
> > accept at least common C++ containers (like std::vector or std::map, or
> > probably a GCC specific variant of them whiwh would be notably
> > gcc_vector<typename ElemType,bool GGCed) and gcc_map<typename
> > Keytype,typename Elemtype,bool GGCed>)

Actually, this brings another question: is vec.h deprecated (or at least do we want to
get rid of it for next release), or not yet?

> > If I start working on that (very probably inside the MELT branch at first)
> > do I have a reasonable chance for that to be accepted in some trunk?
> Since no other GCC part is using C++ currently, I believe this would
> be rather poor first module choice to convert to C++. If C++ was
> already a non-optional requirement, then C++ conversion would be OK,
> but I believe this rewrite should be made in conjunction with current
> requirements and not in anticipation of some future requirement (or
> you risk rewriting it twice).

I don't understand that last sentence. Gengtype is precisely a utility
independent of GCC usage (outside of plugin development), in the sense that once GCC has
been built you don't need it (except for plugins). So I would believe that it is the
less risky part to "rewrite" in C++ (because it is an independent executable, not needed
for the vast majority of GCC users, e.g. for all users of a Linux-distribution packaged
GCC not compiling GCC plugins).

And my feeling is that C++ is now in principle required for GCC. For instance, you need
it to compile the Go front-end.

Diego Novillo wrote:
> It already is.  We bootstrap in C++ mode.  I don't see a problem 
> starting to move some code to C++.  Whether this is a good chunk of code 
> to convert is another question.

Well, I think it is a good code to convert, because it has a limited dependency, and
because gengtype is really really ugly today. Few people understand it (I am partly of
them) and those who do, think it is ugly code (and very few people really can understand
it, because most questions about gengtype remain unanswered.).

> Basile, I don't see a problem with your plan, in principle.

(I have not fully decided yet yo work on it; currently it is a wish mostly; is it ok to
use the MELT branch for that also??? I believe I don't want to work on two branches!)

email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]