Calling Conventions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Calling Conventions

Jon Sargeant
I'm trying to understand the LLVM calling conventions.  Coming from a
Windows C++ background, I'm familiar with three calling conventions:
cdecl, stdcall, and fastcall.  It looks like cdecl corresponds to ccc in
LLVM, but I'm not sure about the other two.

Best Regards,
Jon
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Calling Conventions

Gordon Henriksen-3
On Mar 31, 2008, at 22:14, Jon Sargeant wrote:

> I'm trying to understand the LLVM calling conventions.  Coming from  
> a Windows C++ background, I'm familiar with three calling  
> conventions: cdecl, stdcall, and fastcall.  It looks like cdecl  
> corresponds to ccc in LLVM,

Correct.

> but I'm not sure about the other two.

In LangRef.html, the stdcall and fastcall conventions you know are  
lumped under "cc <n>" for target-specific conventions, although I  
think there is special support in the LLVM assembly language for these  
two.

In CallingConv.h, they're available with the symbolic constants  
CallingConv::X86_StdCall (64) and CallingConv::X86_FastCall (65).

Note that fastcc / CallingConv::Fast is not fastcall. (It's actually  
an alias for ccc...)

— Gordon


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Calling Conventions

Anton Korobeynikov
In reply to this post by Jon Sargeant
Hello, Gordon.

> think there is special support in the LLVM assembly language for these  
> two.
Yes, afair - x86_stdcallcc and x86_fastcallcc

> Note that fastcc / CallingConv::Fast is not fastcall. (It's actually  
> an alias for ccc...)
No, at least on x86.

--
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev