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

Stefan Strasser sstrasser at systemhaus-gruppe.de
Sat May 28 10:32:30 EDT 2005


Am Samstag, 28. Mai 2005 16:15 schrieb John Morrison:
> Hi;
>
> Ah, everything is more complicated than it looks.  Geez but C++ sucks
> (in terms of complexity).

try to export uninstantiated templates. that is where the fun begins.

>
> On Friday 27 May 2005 04:17 pm, Brad King wrote:
> > Good idea.  GCC-XML dumps the line of every declaration.  File line
> > numbering starts at 1, so any declaration on line 0 must have been
> > generated artificially by GCC.
>
> While the TYPE (in this case an enumeration) is artificial...
>
>   <Enumeration id="_5460" name="_Ios_Fmtflags" context="_2"
> location="f402:55" file="f402" line="55" artificial="1" size="32"
> align="32">
>     <EnumValue name="_M_ios_fmtflags_end" init="65536"/>
>   </Enumeration>
>
> ...it turns out the variable...
>
>   <Variable id="_21381" name="boolalpha" type="_5460c"
> init="(std::_Ios_Fmtflags)1" context="_5776"
> mangled="_ZNSt8ios_base9boolalphaE" location="f402:214" file="f402"
> line="214" extern="1"/>
>
> ...is neither artificial nor attributed to line=0.  Its demangled name
> is...


I'm not sure what you're saying here, that this is a artificial type that you 
want to ignore or that you don't want to ignore?

to me this looks like a real variable and a real type you don't want to 
ignore, so your question is, why the type is artificial="1"?

that's a GCC internal.
since C++
struct A{};
is equal to C:
struct A{};
typedef struct A A;

GCC generates an artificial typedef in the C++ case, which probably is 
exported by gccxml.
I think you can rely on source line != 0 in most cases. the only exception is 
with base/complete constructors iirc. 


>
> [jm at jmorrison xml]$ c++filt
> _ZNSt8ios_base9boolalphaE
> std::ios_base::boolalpha
> [jm at jmorrison xml]$
>
> ...and my parser is not Smart Enough to avoid spitting out the
> variable declaration for a filtered-out type.

...so don't filter out artificial types


-- 
Stefan Strasser



More information about the gccxml mailing list