[Rock-dev] clang vs. typelib

Janosch Machowinski Janosch.Machowinski at dfki.de
Tue Jul 15 17:49:35 CEST 2014


On 15.07.2014 17:45, Martin Zenzes wrote:
> Hi,
>
> playing around a little bit, reading into this nice codebase of
> LLVM/clang and talking to Matthias. Concerned with this horrible state
> of gccxml -- no offense -- but it does not make sense to force it to
> cross-compile if it is going to be replaced sooner than later. So:
>
> What does a replacement for gccxml in typelib have to provide:
> - the full qualifying names of all types defined in a given set of
> header-files
> - their memory layout: offset+type of all members, the sizeof the type
> itself
> right?
Jup, plus name of the member itself ;-P
>
> Nice would be:
> - bail out if types use too fancy features, like virtual functions or
> dynamic members (except some whitelisted special cases)
Actually this is needed, as typlelib can't deal with any class, that has a
virtual table.
>
> The proof-of-concept-level stuff I have so far is living in
> $WIESE/temp/mzenzes/clang-typelib.bare but it would make more sense to
> push it out into the internet -- should i use my private github account
> for things like this?
Sound like a good idea.
>
> --
>
>
> The second point can be done using "clang -fdump-record-layouts" (see
> http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-July/037778.html. It
> results in an output like this:
>
>      0 | struct base::JointState
>      0 |   double position
>      8 |   float speed
>     12 |   float effort
>     16 |   float raw
>        | [sizeof=24, dsize=20, align=8
>        |  nvsize=20, nvalign=8]
>
> for the first point (and third) "clang-check -ast-list" could be used --
> but it prints too much. So a small clang-tool with added filtering might
> come in handy?
>
> Greetings
>       Martin
>
> ps: sorry if this is posted twice... my mail client?


-- 
  Dipl. Inf. Janosch Machowinski
  SAR- & Sicherheitsrobotik

  Universität Bremen
  FB 3 - Mathematik und Informatik
  AG Robotik
  Robert-Hooke-Straße 1
  28359 Bremen, Germany
  
  Zentrale: +49 421 178 45-6611
  
  Besuchsadresse der Nebengeschäftstelle:
  Robert-Hooke-Straße 5
  28359 Bremen, Germany
  
  Tel.:    +49 421 178 45-6614
  Empfang: +49 421 178 45-6600
  Fax:     +49 421 178 45-4150
  E-Mail:  jmachowinski at informatik.uni-bremen.de

  Weitere Informationen: http://www.informatik.uni-bremen.de/robotik



More information about the Rock-dev mailing list