[cfe-dev] Getting meta-data into Clang's AST

chris nuernberger cnuernber at gmail.com
Tue Jul 6 09:43:48 PDT 2010


Ah, I see, thanks for that info.

So Clang at this point supports both types of attributes, I would
guess?  Are there examples using one or the other (ideally the c++0x
standard)?  Where are these objects placed on the AST?

This sounds much better than comments so far.

My project is being paid for by my employer, NVIDIA, so making any of
it public would be a negotiation to say the least.  It really would
depend on how independent I can make it of the PhysX code base.

At this point I am not pursuing that option but the first portion was
completely independent of the code base and if I do it correctly this
portion will be also.  If people are interested I will certainly press
for it once my current set of objectives are met.

I do feel that c++ has needed good introspective capabilities for a
long time and I am carefully walking down that general path.

Chris

On Sat, Jul 3, 2010 at 3:38 AM, Cédric Venet <cedric.venet at laposte.net> wrote:
>  Le 02/07/2010 22:59, chris nuernberger a écrit :
>>
>> OK, now I know what you mean by attributes; these won't work for me.
>>
>> You meant things like _cdecl and such, correct?
>
> not really, attributes are part of C++0x specification using the syntax
> [[...]] but gcc had another syntax since a long time (__attribute__((...))
> ):
> http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html
> MSVC has something similar with __declspec
>
> if you want other compiler to ignore your attribute, I think you need to put
> them in a macro:
>
> #if METADATAPARSING
> #define ADD_MYATTRIB(param) __attribute__((myattrib(param)))
> #else
> #define ADD_MYATTRIB(param)
> #end
>
> class A {
>    int m ADD_MYATTRIB("blabla");
> };
>
>
> or something like that.
>
> Your project seems interesting, will the code be public?
>
> regards,
>
> --
> Cédric
>



-- 
A foolish consistency is the hobgoblin of little minds - Emerson




More information about the cfe-dev mailing list