[GCC-XML] Determining template parameter types

Brad King brad.king at kitware.com
Sat Aug 16 13:02:38 EDT 2008


Chris Waldron wrote:
>   I'm interested in at least taking a look at the effort required to
> implement this feature.  Can you point me in the right direction?

There are two steps.  First, you'll need to manually write some example 
output to propose a format for the XML dump and send it to me for 
discussion.  Then, you can proceed to actually implementing it.

Both parts will be difficult.  C++ templates have a lot of nasty little 
details that must be handled.  Specializations (partial and full) must 
be treated with care.  The two parts may be tied together due to limits 
on the information provided by the internal representation of GCC.

The actual implementation will require diving into the GCC internal 
representation.  Take a look at gccxml/GCC/gcc/cp/xml.c for the current 
dump implementation.  The function xml_add_template_decl is where to 
dispatch dumping of the actual templates.  Currently it just looks for 
instantiations of the templates it encounters.  Look next to xml.c for 
the cp-tree.h file which partially documents some of GCC's representation.

-Brad


More information about the gccxml mailing list