[LLVMdev] Exact meaning of byval

Duncan Sands baldrick at free.fr
Thu Jul 10 04:20:38 PDT 2008


Hi Richard,

> In that case if you did want the callee to copy the argument am I right 
> in thinking that the Frontend would have to pass a pointer and add an 
> explicit memcpy in the callee?

I'm not sure what you are asking.  Of course caller or callee can
always allocate some temporary on the stack and memcpy to it, then
use that copy from then on.  The point of byval is that the copy is
made where the ABI mandates it for by-value call parameters.  If
you don't need to be ABI compatible then there is no point using
byval: it would be better to use an explicit temporary and memcpy.

Ciao,

Duncan.



More information about the llvm-dev mailing list