[LLVMdev] Access a specific address in the JIT compiler

Olivier Meurant meurant.olivier at gmail.com
Thu Jun 11 04:17:42 PDT 2009


This seems to be the "proper" way to do that.

Another possibility, is to create a ConstantInt with the size of the pointer
(found in TargetData), then do a IntToPtr cast, and use this absolute
address in load/store/call.

Cheers,
Olivier.


On Thu, Jun 11, 2009 at 12:27 PM, Camille Troillard
<camille at osculator.net>wrote:

> Hi,
>
> I am using the JIT compiler to execute code that must interface with
> the running process.
> I would like to access some specific addresses.
>
> The solution I found is to create a global variable for each address I
> want to reference, and pass it as a mapping to the ExecutionEngine
> with addGlobalMapping.
>
> Is that how I should do this?
> Is there no way to just reference the addresses with constants?
>
>
> Best,
> Cam
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090611/12186791/attachment.html>


More information about the llvm-dev mailing list