[cfe-dev] Replacing (a subset of) gccxml by a clang plugin

João Matos ripzonetriton at gmail.com
Sat Sep 15 16:39:46 PDT 2012


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:
https://github.com/tritao/cxxi/blob/master/src/Parser/Parser.cpp

Hope it helps.

On Sat, Sep 15, 2012 at 10:36 PM, Sean Silva <silvas at purdue.edu> wrote:

> >   2. binary layout of the fields (i.e. offsets from beginning of the
> > class/struct/union)
>
> Look at the class ASTRecordLayout.
>
> --Sean Silva
>
> On Sat, Sep 15, 2012 at 4:12 AM, Sylvain Joyeux <sylvain.joyeux at m4x.org>
> wrote:
> >
> > (Please CC me as I am not subscribed to this list)
> >
> > Hello. I have a few questions on how I could replace gccxml by a clang
> > plugin in some tooling I have.
> >
> > What I need is:
> >   1. discovery of all the types. I need only the fields (don't care
> > about members), their visibility and whether classes have virtual
> > methods / base classes
> >   2. binary layout of the fields (i.e. offsets from beginning of the
> > class/struct/union)
> >
> > Where I got so far:
> >   * the information in 1. are given by RecordDecl, which can be
> > discovered by registering an ASTConsumer (method HandleTagDecl)
> >
> > What I miss:
> >   * how can I get the information from 2 ?
> >
> > Thanks in advance for comments / pointers
> >
> > Sylvain Joyeux
> > _______________________________________________
> > cfe-dev mailing list
> > cfe-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>



-- 
João Matos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120916/4e5841b5/attachment.html>


More information about the cfe-dev mailing list