This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mixing JIT and GCC (with a precompiled header?)?

Hello all,

Suppose that I have some header file in C myhead.h, containing notably

     // Boehm's garbage collector, notably defines GC_malloc_atomic & GC_malloc
     #include <gc/gc.h>
     struct myintvec_st {
       unsigned vsiz; // allocated size
       unsigned vlen; // used length, always <= vsiz
       int varr[];

     static inline struct myintvec_st*vec_alloc(unsigned siz) {
        size_t fullsiz = sizeof(struct myintvec_st)+siz*sizeof(int));
        struct myintvec_st* v = GC_malloc_atomic(fullsiz);
        memset(v, 0, fullsiz);
        v->vsiz = siz;
        return v;

and many other struct declaration and static inline functions and extern function declarations.

Now, I would like to use libgccjit with a context which contains all
the functions & structures from file myhead.h, in particular because I
want to JIT some calls to inlined static functions, and I expect the
gccjit to do the inlining (assuming I am using JIT with -O2 by calling
gcc_jit_context_set_int_option with

How is that possible? What should be done to make that possible?

I imagine that we might need a new function which initialize a
gcc_jit_context from a precompiled header...

Where should it go?

Basile Starynkevitch

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]