Questions tagged [libgccjit]

libgccjit is an API for embedding GCC inside programs and libraries.

libgccjit is an API for embedding GCC inside programs and libraries. It aims to provide an embeddable shared library with an API for adding compilation to existing programs using GCC as the backend:libgccjit.so.

This shared library can then be dynamically-linked into bytecode interpreters and other such programs that want to generate machine code "on the fly" at run-time.

There are actually two APIs for the library:

a pure C API: libgccjit.h a C++ wrapper API: libgccjit++.h. This is a collection of “thin” wrapper classes around the C API, to save typing.

Documentation: https://gcc.gnu.org/onlinedocs/jit/

3 questions
3
votes
1 answer

GCCJIT, get the size of a type

Given a gcc_jit_type pointer is there any way to get its size? I have been looking over the documentation and I can't really find an example of something like the sizeof operator. I would like to write a kind of generic data structure which is…
chasep255
  • 11,745
  • 8
  • 58
  • 115
2
votes
0 answers

get result type in operations with libgccjit

I am implementing a jit compiler with libgccjit and am stuck when trying to retrieve the result of a binary operation. It isn't getting the result that's the issue, but declaring the type of the result. I have two gcc_jit_rvalues and want to perform…
RamblingMad
  • 5,332
  • 2
  • 24
  • 48
0
votes
1 answer

libgccjit importing function

I'm using libgccjit to build an just in time function for my test. In particular, I want to import "memcpy" function, but I'm unsure how to do it. My current guess from looking at the documentation from…