[GCC-XML]Including typedefs in the type graph.
Brad King
brad.king at kitware.com
Mon Nov 17 16:17:58 EST 2003
Hi Paul,
On Sun, 26 Oct 2003, Paul Ross wrote:
> I am using gccxml (great product by the way!) for an API documentation
> project and I was wondering whether it was possible to include typedef
> information in the graph that resolves type information.
I've now implemented this feature and it is in the CVS version. It seems
to work well in most cases I've tested. However, GCC throws away the
typedef in the motivating example, and I have not found any way to recover
it.
If the function definition is not present and the typedef is the top-level
type, GCC throws away the fact that the typedef was the type used in the
source. I suspect this has to do with the implementation of C++ standard
rules about adjusting the top-level type of a function argument to remove
cv-qualifiers and change an array type to a pointer type. For example:
typedef int INT;
void foo1(INT); // references "int"
void foo2(INT) {} // references "INT"
void foo3(INT*); // references "pointer to INT"
I think this is the best that can be done. Please prove me wrong if you
can.
-Brad
More information about the gccxml
mailing list