[GCC-XML] 2 newbie questions about "pseudo"

Brad King brad.king at kitware.com
Fri May 27 12:04:06 EDT 2005


John Morrison wrote:
> I am getting XML records for C++ ABI symbols with variations of
> "pseudo" appended to them:
> 
> __base_class_type_info_pseudo
> __class_type_info_pseudo
> __si_class_type_info_pseudo
> __type_info_pseudo
> __vmi_class_type_info_pseudo1
> __vmi_class_type_info_pseudo2
> 
> (1) What's with the "pseudo" suffix?  I could not seem to find any
> hits for these symbols either in /usr/include or via Google.

They must be some internal implementation detail of the ABI implemented 
by the GCC whose parser is used by GCC-XML.

> (2) I am trying to automagically generate bindings for the C++ code,
[snip]
> What's the Right Thing To Do?  Ignore them?  If so, how I do I
> programmatically detect these "pseudo" symbols in a reliable way, as
> there does not seem to be an XML attribute I can use to detect them?

There are three approaches that come to mind:

1.) If the name starts with "__" then you can ignore it because that 
namespace is reserved for internal implementation details of a compiler.

2.) Look for the "artificial" attribute for members of the global 
namespace.  This may be a sufficient filter.

3.) Use the -fxml-start option to avoid getting the extra types.  You 
just specify a starting declaration and the dump will only include 
things referenced by it.  Nothing references these "pseudo" declarations 
so they will not be dumped.

GCC-XML was originally written to support another tool that generates 
bindings.  I used option #3 because it also provides a nice way to let 
the user specify what parts of the interface to wrap and instantiate 
templates to be wrapped.

-Brad



More information about the gccxml mailing list