[LLVMdev] Getting the memory address of all operands on an expression

Duncan Sands baldrick at free.fr
Tue Jun 18 23:02:15 PDT 2013


On 19/06/13 03:12, Abhinash Jain wrote:
> In short if suppose i have some expression as a=b+c-d*e,  and with the help
> of LLVM pass i want to make a string like this:-
>
> "[Hexadecimal address of 'b'] [opcode of +] [Hexadecimal address of 'c']
> [opcode of -] [Hexadecimal address of 'd'] [opcode of *] [Hexadecimal
> address of 'e']".
>
> Than how can i make it................

You can't, because addresses are only known at run-time, while passes are run at
compile time.  If you are running the program using the JIT then you can try to
extract the info at run-time from the internal JIT data structures.

Ciao, Duncan.



More information about the llvm-dev mailing list