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

chris nuernberger cnuernber at gmail.com
Fri Jul 2 10:03:52 PDT 2010

I completed (quite easily) the first part of my task which was to get
clang to parse some c++ objects and write out some serialization
mappings for them.

Now I have seemingly much harder task which is to parse some c++
objects and not only get their binary layout but also to be able to
read some pretty arbitrary meta data about each member.

Is there a recommended way to add in meta data to the Clang AST from
the parser?  I noticed comments seem to be completely stripped; is
this the case or did I mis-read something?

Comments would be ideal as the other compilers for these objects will
then definitely ignore the data, but I could also declare a special
objects with string constants or something like that; assuming it
didn't change the binary layout of the object.

Has anyone done something like this before?


A foolish consistency is the hobgoblin of little minds - Emerson

More information about the cfe-dev mailing list