about header file parsing

David Malcolm dmalcolm@redhat.com
Tue Jan 1 00:00:00 GMT 2019


On Tue, 2019-01-08 at 10:50 +0000, akrl@sdf.org wrote:
> Hi all,
> I have a basic question.
> Is there a way to ask libgccjit to parse a conventional .h file?

Sadly, no.

> Or alternatively is there a way to have an header file parsed and
> converted in the equivalent libgccjit api calls?

Having a standard way to do this would be useful.

> I ask this because I noticed that, if you jit some code that have to
> inter-operate with non jitted code, maintaining two duplicated
> definitions
> of all data structures can be quite painful if these are not trivial.

I agree that this is a nuisance.

> Alternatively what's the suggested work flow?

One idea I came up with was to use libabigail:
  https://sourceware.org/libabigail/
to generate an ABI description e.g. via abidw:
  https://sourceware.org/libabigail/manual/abidw.html
which emits an XML file, and then have a pre-canned way of populating a
gcc_jit_context from such an abigail ABI representation.

This code doesn't exist yet, though (but would just need writing once).

Dave

> Best Regards
>   Andrea
> 



More information about the Jit mailing list