Fwd: Merging the cxx-conversion branch into trunk

Tobias Burnus burnus@net-b.de
Thu Aug 2 20:27:00 GMT 2012


For your interest. The conversion to C++ should have no real effect for 
the Fortran front end – except that bootstrapping without C++ is no 
longer possible. Unless you have used 
--disable-build-poststage1-with-cxx there should be no difference.

See also http://gcc.gnu.org/wiki/cxx-conversion

For the new coding conventions, see 
http://gcc.gnu.org/codingconventions.html and 
http://gcc.gnu.org/wiki/CppConventions



Possibly most relevant from the coding convention document:

* C-style casts should not be used. Instead, use C++-style casts.

* Variables should be defined at the point of first use, rather than at 
the top of the function. The existing code obviously does not follow 
that rule, so variables may be defined at the top of the function, as in 
C90.

* Variables may be simultaneously defined and tested in control expressions.


However, the wiki version contains:

* In new code variables which are used in a small scope should be 
defined at the point of first use, rather than at the top of the 
function. Variables which are used throughout the function may be 
defined at the top of the function, as in C.


I think we should stick for now to the old C convention. (In any case 
until the C++ conversion is done; currently, some users still compile 
GCC with C.)

Tobias

-------- Original Message --------
Subject: Merging the cxx-conversion branch into trunk
Date: Thu, 02 Aug 2012 11:58:06 -0700
From: Diego Novillo
To: gcc, Lawrence Crowl



We are about ready to have the cxx-conversion branch merged back into trunk.

This merge will change the following:

1- The compiler can only be built with a C++ compiler.

2- The tree macros can be called from gdb (when GCC is built with -g3).

3- htab and VEC have been converted to use C++ templates. The existing
API is still present as wrappers that call the new API. We will change
this after the branch is merged.

4- gengtype is now capable of supporting user-defined structure markers.
This allows users to have structures in GC memory for which gengtype
does not know how to generate marking code for.

I am currently debugging this change. After I fix the remaining PCH
failures, I will send the patch for review.


Our immediate plan after we merge the branch into trunk includes:

- Fix any failures caused by the change.
- Modifying all the user code for VEC and htab to use the new interfaces.
- Convert double_int.
- Convert cgraph.
- Convert the pass manager.
- Convert hooks.

After this round of changes, we are planning to work on more API
cleanups (e.g., adding the introspection API that would be usable for
plugins as we discussed in the Plugins BoF in Prague).

I would also like to reduce the amount of code that is being generated
by gengtype. There is a lot of boilerplate code that could be offloaded
to user-provided functions. This would reduce the number of GTY markings
that we need to support. There are other aspects of this that I will
include in the gengtype patch that I'm finishing up.

We will keep the branch alive to work on bigger scale changes that will
not be ready for this release (e.g., experimenting with gimple and tree).

I will split up the merge patch in 4 or 5 chunks to simplify reviews.
For now, we would appreciate if folks test the branch with:

$ svn co ssh://gcc.gnu.org/svn/gcc/branches/cxx-conversion
$ mkdir bld && cd bld
$ ../cxx-conversion/configure --enable-languages=all,ada,go && make
bootstrap && make check

We welcome any suggestions (and volunteers!)


Thanks.





More information about the Fortran mailing list