about header file parsing
akrl
akrl@sdf.org
Tue Jan 1 00:00:00 GMT 2019
Basile Starynkevitch <basile@starynkevitch.net> writes:
> I don't know of any GCC plugin within the GCC code base (except the test cases for plugins).
>
> And I am not sure it would be that easy. If I understand well,
> what you suggest would either fill some gcc_jit_context, or create it already filled with an API.
>
> But, AFAIK, there is no current way to query the content of some gcc_jit_context. In other words, it
> seems (but I could be wrong) that what is lacking is an API to e.g. *fetch* all the struct-ures and
> all the functions inside a gcc_jit_context, and we don't have that yet.
>
> Or perhaps, I have misundertood your idea.
>
> My feeling was that the GCC plugin would fill whatever data structure is used by the application using libgccjit.
> And that is application specific -so the GCC plugin has to be application specific too.
>
> Cheers
>
> PS. I could be very wrong, it is not clear in my head!
>
Sorry I try to explain it better.
I was thinking to a gcc plugin (or potentially something else) that
given a C file produce the libgccjit code necessary to fill a context
with what is in the source file.
Say you want then to use it to solve the code duplication we have seen for
structure definitions. You could use a two step compilation strategy:
- first with the plugin you create the libgccjit code you need to define
in the jitter the structures.
- second you include it in your codebase and you do your usual compilation.
As I sayid it could also potentially compile not just structs and unions
but also the whole C subset supported.
Bests
Andrea
--
akrl@sdf.org
More information about the Jit
mailing list