[LLVMdev] Calling Conventions Cont'd

Jon Sargeant delta17 at cox.net
Sat Apr 12 13:22:24 PDT 2008

What is the correct procedure for translating a function signature from 
a high-order language to LLVM?  It looks like I replace each 
struct/array parameter with a 'byval' pointer parameter, and I replace a 
result struct/array with an 'sret' pointer parameter.  The reason I ask 
is that each calling convention has subtle variations for each 
architecture and platform.  For example, cdecl in Win32 returns small (8 
bytes or less) structures in EAX or EAX:EDX; whereas, cdecl in Linux 
always returns structures "in memory" (Source: 
http://www.programmersheaven.com/2/Calling-conventions).  Does LLVM 
handle all of these nuances for me?


More information about the llvm-dev mailing list