0

I am using LLVM's Python bindings - and, so far, I've been able to generate Constant values using LLVM. However, I am confused as to how to store them within an address.

This is probably a very basic question - how do I store a constant in memory? How do I later access that memory location for that value?

1 Answer 1

1

In general, storing values to an address is done via a store instruction (builder.store) and accessing a value within an address is done via a load instruction (builder.load). It doesn't matter if the argument to the store instruction is a constant or not.

If you're referring to constant GlobalVariables, however, be aware they are already stored in an address when you create them.

1
  • Ah, that makes sense - thank you. I will edit the title to be a bit more accurate.
    – sdasdadas
    Aug 5, 2013 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.