[GCC-XML] Mark templated functions

Brad King brad.king at kitware.com
Mon Sep 24 08:32:54 EDT 2012

On 09/22/2012 05:30 PM, Andrej Mitrovic wrote:
> Hi,
> Is there any way to modify gccxml to export an "isTemplate" field to
> the xml for functions/methods? I specifically mean functions which are
> templated, not ordinary functions that belong to templated classes.
> I have a codegenerator in which I want to avoid generating templated
> functions because writing C wrappers is hard without knowing how to
> invoke the templated function. I want to filter them out entirely.
> I could try to parse the "demangled" field and figure out if a
> function is templated, but this is unreliable.

Look in GCC/gcc/cp/xml.c at the xml_add_template_decl function.
There is a loop to dump member template instantiations.  You could
start there to look for a way to do this.


More information about the gccxml mailing list