Displaying 2 results from an estimated 2 matches for "another_fn".
2009 May 24
3
[LLVMdev] llvm address of
...nction dynamically in llvm
(a la http://llvm.org/docs/tutorial/JITTutorial1.html) but after half a day
of searching I still haven't found how to create the equivalent of the &
(address of) operator in the llvm API, more exactly how do I obtain the i8*
from the i32 below
void fn(int x)
{
another_fn(&x);
}
thanks for any suggestions
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090524/77da2175/attachment.html>
2009 May 24
0
[LLVMdev] llvm address of
.../llvm.org/docs/tutorial/JITTutorial1.html) but after
> half a day of searching I still haven't found how to create the
> equivalent of the & (address of) operator in the llvm API, more
> exactly how do I obtain the i8* from the i32 below
>
> void fn(int x)
> {
> another_fn(&x);
> }
>
You should create a temporary variable on the stack, store the value of
'x' to it,
and use the address of that variable as argument to another_fn.
You can simply run your example on llvm-gcc/clang with -emit-llvm -S,
and you'll see how it can be done.
Best r...