[GCC-XML] feature request: preprocessor output

Francesco Montorsi f18m_cpp217828 at yahoo.it
Thu Mar 27 08:49:06 EDT 2008


Brad King ha scritto:
> Francesco Montorsi wrote:
>> Is it difficult to add this feature?
>> Is someone working on it?
>> Would you accept a patch which adds a new option to gccxml to add in the
>> XML output such internal "table"? If so, where should I start to look to
>> implement such feature?
> 
> It is not possible to add this feature.  The xml dump is implemented
> inside a patched GCC parser.  All preprocessing is long since over
> before the parser even sees it.  There is no record left of how the code
> was produced from the preprocessor.
ach

> The feature is fairly ill-defined anyway.  Consider
> 
> #define DECL(x,y) \
>   void x(const char* whatsup = y);
> DECL(utility, "something");
> 
> Until the preprocessor is done this makes no sense.
yes, but I'd be interested to know that there is a DECL() macro in the 
sources and that it expands to "void x(const char* whatsup = y);".

I know that the code using the #defined macros/values can have no sense 
until preprocessing is done, but I'd be interested in the macros/values 
themselves and not to the code they produce...

Specifically, for what I'm developing I need to know only #defined 
values, not #defined macros. So I guess I'll grep the sources for 
"#define" and then parse the results...

Francesco




More information about the gccxml mailing list