[GCC-XML] GCC-XML 0.9 - default values

Brad King brad.king at kitware.com
Wed Nov 7 15:37:00 EST 2007


Roman Yakovenko wrote:
> Hi. I am updating pygccxml and found that new GCC-XML introduced new
> challenge - default value.
[snip]
> My question is: is default values dumped as is to the xml file or there
> is some code that transforms a binary representation to string? If there
> is such code can you point me to it?

The "default" attribute is printed by the function

  xml_print_default_argument_attribute

in "GCC/gcc/cp/xml.c".  That gets the value from GCC internals using the
"expr_as_string" function (from GCC/gcc/cp/error.c).  I didn't write
this function...I just take whatever GCC provides.  If function body
support were to be implemented then the default value could instead
reference an expression represented in xml instead of converting it to a
string.

-Brad




More information about the gccxml mailing list