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? Thank you, Dan _________________________________________________________________ Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100409/2a9e8b62/attachment.html>
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