[LLVMdev] Pointer Constant?

Timothy Baldridge tbaldridge at gmail.com
Fri Jul 1 07:30:10 PDT 2011

I'm writing a JIT for my toy language, and I'm confused by one thing.
How do I, with IR Builder, Insert a pointer constant? For the first
version of my jit, I really only need LLVM to pass around opaque types
and then pass those variables to C functions that return other opaque
types. So for instance, I have a Int object that wraps the GNU GMP
routines. A want to be able to tell IRBuilder "create a pointer named
x and set it's value to this memory location".

I know I'd have to re-compile everytime I reload my project, but for
now, and considering it is a JIT, I don't really care.


“One of the main causes of the fall of the Roman Empire was
that–lacking zero–they had no way to indicate successful termination
of their C programs.”
(Robert Firth)

More information about the llvm-dev mailing list