[LLVMdev] Determining the base offset of the stack for a function.
Villmow, Micah
Micah.Villmow at amd.com
Mon Mar 30 12:01:58 PDT 2009
I am running into an issue where if I have multiple functions compiled
in the same compilation unit the stack offset is not starting at zero.
For example:
func1(...)
{
...
}
func2(...)
{
...
}
Say the first function uses 64 bytes of the stack and an assumed offset
of 0 and the second function uses 32 bytes of the stack but an assumed
offset of 64. I've found out how to get the size of the stack via
MachineFrameInfo.StackSize/getObjectSize, however I have not found out
how to determine the starting offset of the stack for that specific
function. I need this information so that I can offset my stack pointer
correctly since all my indices into my stack need to start at 0 for each
independent function call.
So, what this means is that if I call func1 or func2 I need to make sure
all offsets into the stack start at zero.
Thanks for any tips/hints,
Micah Villmow
Systems Engineer
Advanced Technology & Performance
Advanced Micro Devices Inc.
S1-609 One AMD Place
Sunnyvale, CA. 94085
P: 408-749-3966
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090330/726186ed/attachment.html>
More information about the llvm-dev
mailing list