Power up the OrcJIT
authorLuke Lau <luke_lau@icloud.com>
Sun, 2 Jun 2019 18:25:26 +0000 (19:25 +0100)
committerLuke Lau <luke_lau@icloud.com>
Sun, 2 Jun 2019 18:25:26 +0000 (19:25 +0100)
commit2fd7e4f3686c3b977881f995ec12b8dd60e72254
tree578065800dec1befa71ba8fba609d26b72726f35
parent431c4b6e37e414b6959cdf14a50622c514ea0a85
Power up the OrcJIT

We're going to be derivating from the Kaleidoscope tutorial, by using
the newer OrcJIT framework rather than MCJIT.
OrcJIT allows for lazy, On Request Compliation, and is built up of
different layers for linking, compiling, etc.

We start it off by creating a new execution session which will hold all
of our layers, followed by a symbol resolver which we won't need (yet).
We then create the linking and compilation layers, and then a ModuleKey:
something that llvm-hs uses to keep track of modules across each
invocation of withModule.

There's a lot of things to keep track of so I've added a small data type
to hold them all.
Main.hs