This is the mail archive of the gcc-patches@gcc.gnu.org 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: TREE_LIST, a new hope -- from oldlto branch


On Tue, May 04, 2010 at 02:13:28PM +0200, Michael Matz wrote:
> Hello,
> 
> On Mon, 3 May 2010, Steven Bosscher wrote:
> 
> > 	* gcc/stor-layout.c (pending_sizes): Change the type to
> > 	VEC(tree,gc) *.
> 
> If we're doing such cleanups (and I think they're nice), can we at the 
> same time introduce nicer syntax for commonly used vectors?  I really hate 
> reading these "VEC(bla)" things, they are so non-C.  For instance the 
> "VEC(tree,gc)*" type could be named "treegv" (and the heap variant 
> treehv).  

I might agree, but I really find the proposed name treegv to be much
too short and non informative. I would very much prefer a longer, more
understandable, name, eg tree_gcvec_t. Actually, IIRC, VEC(tree,gc)
might expand to something similar (not exactly that).

Besides, such global names belong of course to a common header
(probably gcc/tree.h) and such a typedef should usually not be inside
a particular code file like gcc/stor-layout.c

More generally, I tend to believe that global names should be more
longer and more descriptive. Heuristically I would like most (but not
all) global names to be e.g. at least 8-10 characters long.

FWIW, the naming conventions inside GTK are IMHO much easier to use
and remember. Of course, this gives much longer names (but every
decent editor has name completion).

Remember, GCC is a 4MLOC monster, and any conventions which makes its
code easier to read (by newscomers) should be welcome. A nearly
systematic convention (same as in GTK) that every public name of
module foo*.c & foo.h should start with foo_ is welcome (and already
followed in the gimple code).


Regards.

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


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