[llvm-dev] get function parameters (not arguments)

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 10 08:09:53 PST 2017


On 10 March 2017 at 08:06, Mohammad Norouzi <mnmomn at gmail.com> wrote:
> what about the memory address of e and f? can i get them?

Not in general, again. After optimizations they probably won't even
have a fixed memory address. For example on AArch64 that code might
become something like:

    main:
        mov w0, #10
        mov w1, #22
        bl foo
        ret

Where e and f only ever exist in registers.

In some cases you might get lucky and see that the Value used in the
call came from a load instruction, and then you could get its address
from that. But it's not something you can rely on for correctness.

Cheers.

Tim.


More information about the llvm-dev mailing list