I've been changing a project from GCC XML to Clang, but I'm using the API directly instead of a plugin, so might give you a starting point. You can look at the code at: 
<a href="https://github.com/tritao/cxxi/blob/master/src/Parser/Parser.cpp">https://github.com/tritao/cxxi/blob/master/src/Parser/Parser.cpp</a> <div><br></div><div>Hope it helps.<br><br><div class="gmail_quote">On Sat, Sep 15, 2012 at 10:36 PM, Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">>   2. binary layout of the fields (i.e. offsets from beginning of the<br>
> class/struct/union)<br>
<br>
</div>Look at the class ASTRecordLayout.<br>
<span class="HOEnZb"><font color="#888888"><br>
--Sean Silva<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Sat, Sep 15, 2012 at 4:12 AM, Sylvain Joyeux <<a href="mailto:sylvain.joyeux@m4x.org">sylvain.joyeux@m4x.org</a>> wrote:<br>
><br>
> (Please CC me as I am not subscribed to this list)<br>
><br>
> Hello. I have a few questions on how I could replace gccxml by a clang<br>
> plugin in some tooling I have.<br>
><br>
> What I need is:<br>
>   1. discovery of all the types. I need only the fields (don't care<br>
> about members), their visibility and whether classes have virtual<br>
> methods / base classes<br>
>   2. binary layout of the fields (i.e. offsets from beginning of the<br>
> class/struct/union)<br>
><br>
> Where I got so far:<br>
>   * the information in 1. are given by RecordDecl, which can be<br>
> discovered by registering an ASTConsumer (method HandleTagDecl)<br>
><br>
> What I miss:<br>
>   * how can I get the information from 2 ?<br>
><br>
> Thanks in advance for comments / pointers<br>
><br>
> Sylvain Joyeux<br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Joćo Matos<br>
</div>