This is the mail archive of the gcc@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: wish: generation of type annotation for C++11 code.


On Thu, 10 Nov 2011 13:11:49 +0100
David Brown <david@westcontrol.com> wrote:
> 
> I don't know why you say such a feature would only help C++ newbies - my 
> guess is that it would be at least as helpful to experts.  But maybe 
> /real/ C++ experts have a different opinion there!

Yes, perhaps you're right. But certainly newbies will find it useful. We do agree that
such a feature would be useful.
> 
> You might get something useful from the "-fdump-" options:
> <http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html>

The dumps are mostly middle-end (i.a. after gimplification), and I think what is needed
for such type annotation is the most precise possible location information (at least,
as start end interval of line & column number & file path, perhaps more, like what Dodji
is doing...), and all the dump outputs I looked into don't have precise location
information anymore. But I admit I did not looked into all possible kind of dump files.

> I don't know which pass would be best for you, and obviously the use in 
> an editor depends entirely on the editor.

Agreed, but we can do what Ocaml does more or less. We could document the format of the
annotation type file. Perhaps even, it could become eventually some kind of "de facto
standard" (like the output of -M is today for "make like dependencies"). Using that file
is not the responsability of GCC (but producing it is)!

Of course, GCC should not care of a specific editor. But I believe that if we had an
easily parsable & somehow stable well defined & documented textual annotation file format,
editor communities (e.g. GNU emacs community) will be happy to use it.
(IIRC Ocaml type annotation files are used by more than one tool).

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 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]