Does libgccjit support union definitions?

David Malcolm dmalcolm@redhat.com
Thu Jan 1 00:00:00 GMT 2015


On Tue, 2015-06-09 at 22:50 +0100, Dibyendu Majumdar wrote:
> On 9 June 2015 at 22:33, Dibyendu Majumdar <mobile@majumdar.org.uk> wrote:
> > LLVM does not support unions - so one has to use structs and casts
> > etc. Does libgccjit support union types?
> >
> 
> I see that there is an API to create a union type, although this is
> not described in the online docs. So in general are the online docs
> kept up to date or should I just refer to the header file?

libgccjit does support union types; I just forgot to document them.

The online docs are up-to-date, but they may be incomplete in places, as
in this case.  Please let the mailing list know if you see any other
things that aren't documented (or file them as bugs against the "jit"
component).

For an example of using a union type, see this testcase:
https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/jit.dg/test-accessing-union.c

Dave



More information about the Jit mailing list