[GCC-XML] Parameter names in xml output for function declarators

Andreas Degert ad at papyrus-gmbh.de
Fri Apr 29 14:39:52 EDT 2005


Hello,

the xml output of gccxml supplies parameter names for functions, but
not for function declarators. Would the appended patch to change that
be acceptable? I'm not a gcc expert, so I hope the patch makes
sense.. at least it works for me. I think it's quite valuable for
projects using gccxml to scan header files, e.g. for language
bindings.

ciao
Andreas

cvs diff: Diffing GCC/gcc/cp
Index: GCC/gcc/cp/decl.c
===================================================================
RCS file: /cvsroot/GCC_XML/gccxml/GCC/gcc/cp/decl.c,v
retrieving revision 1.6
diff -u -r1.6 decl.c
--- GCC/gcc/cp/decl.c   21 Nov 2003 21:29:54 -0000      1.6
+++ GCC/gcc/cp/decl.c   29 Apr 2005 18:29:06 -0000
@@ -7709,6 +7709,9 @@
   decl = grokdeclarator (declarator, declspecs, NORMAL, initialized,
                          &attributes);

+  if (TREE_CODE (decl) == FUNCTION_DECL)
+    DECL_ARGUMENTS (decl) = last_function_parms;
+
   deprecated_state = DEPRECATED_NORMAL;

   if (decl == NULL_TREE || TREE_CODE (decl) == VOID_TYPE)



More information about the gccxml mailing list