[LLVMdev] offset of extra function argument

Eli Friedman eli.friedman at gmail.com
Fri Apr 9 15:21:08 PDT 2010


On Fri, Apr 9, 2010 at 3:10 PM, dan mihai <dnmh68 at hotmail.com> wrote:
> Hi,
>
> I am instrumenting certain calls, and want to add an extra argument.
> Say
>    original:   foo(int x, int y)
> changed into
>    modified: foo(int x, int y, int EXTRA)
>
> This is in opt, before lowering.
> Given the list of original arguments, is it possible to tell the stack
> offset of the EXTRA argument?

On many architectures, like x86-64, EXTRA isn't on the stack at all.
In general, LLVM doesn't calculate the locations of arguments until
the instruction selection (i.e. deep in CodeGen).

-Eli




More information about the llvm-dev mailing list