wish: generation of type annotation for C++11 code.

Basile Starynkevitch basile@starynkevitch.net
Thu Nov 10 17:30:00 GMT 2011


On Thu, 10 Nov 2011 12:54:52 +0000
Jonathan Wakely <jwakely.gcc@gmail.com> wrote:

> Doesn't DWARF debug info already contain all that info anyway?

It is not a textual file, and it is not easily parsable. Nobody would write a DWARF
parser in a few hundreds lines of Emacs Lisp.

> 
> > Of course, such a thing could be done by some GCC plugin, but I believe providing the
> > feature inside GCC itself, and documenting the format of the textual type annotation
> > file, would give this feature more visibility, and it would help people a lot. And I am
> > pretty certain that the C++ frontend does compute the type of each expression, so it is
> > mostly the point of defining a textual type annotation format and output it.
> 
> What's the point of plugins if they aren't used to do this sort of thing?

In that precise case (generating type annotation) I believe it is a common enough need to
be provided by the compiler. And by experience, most people don't use plugins. Having two
arguments like eg 
 g++ -fplugin=c++-type-annotation -fplugin-arg-c++-type-annotation-output=myfile.annot) 
makes a difference with having one argument: -fc++-type-annotation=myfile.annot

I agree there is a chicken & egg issue: editors (or IDE-s) won't provide the framework to
use that as log as GCC won't produce them, and vice versa.

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} ***



More information about the Gcc mailing list