1 //===-- llvm/CallingConv.h - LLVM Calling Conventions -----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines LLVM's set of calling conventions.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CALLINGCONV_H
15 #define LLVM_CALLINGCONV_H
19 /// CallingConv Namespace - This namespace contains an enum with a value for
20 /// the well-known calling conventions.
22 namespace CallingConv
{
23 /// A set of enums which specify the assigned numeric values for known llvm
24 /// calling conventions.
25 /// @brief LLVM Calling Convention Representation
27 /// C - The default llvm calling convention, compatible with C. This
28 /// convention is the only calling convention that supports varargs calls.
29 /// As with typical C calling conventions, the callee/caller have to
30 /// tolerate certain amounts of prototype mismatch.
33 // Generic LLVM calling conventions. None of these calling conventions
34 // support varargs calls, and all assume that the caller and callee
35 // prototype exactly match.
37 /// Fast - This calling convention attempts to make calls as fast as
38 /// possible (e.g. by passing things in registers).
41 // Cold - This calling convention attempts to make code in the caller as
42 // efficient as possible under the assumption that the call is not commonly
43 // executed. As such, these calls often preserve all registers so that the
44 // call does not break any live ranges in the caller side.
47 // GHC - Calling convention used by the Glasgow Haskell Compiler (GHC).
50 // Target - This is the start of the target-specific calling conventions,
51 // e.g. fastcall and thiscall on X86.
54 /// X86_StdCall - stdcall is the calling conventions mostly used by the
55 /// Win32 API. It is basically the same as the C convention with the
56 /// difference in that the callee is responsible for popping the arguments
60 /// X86_FastCall - 'fast' analog of X86_StdCall. Passes first two arguments
61 /// in ECX:EDX registers, others - via stack. Callee is responsible for
65 /// ARM_APCS - ARM Procedure Calling Standard calling convention (obsolete,
66 /// but still used on some targets).
69 /// ARM_AAPCS - ARM Architecture Procedure Calling Standard calling
70 /// convention (aka EABI). Soft float variant.
73 /// ARM_AAPCS_VFP - Same as ARM_AAPCS, but uses hard floating point ABI.
76 /// MSP430_INTR - Calling convention used for MSP430 interrupt routines.
79 /// X86_ThisCall - Similar to X86_StdCall. Passes first argument in ECX,
80 /// others via stack. Callee is responsible for stack cleaning. MSVC uses
81 /// this by default for methods in its ABI.
84 /// PTX_Kernel - Call to a PTX kernel.
85 /// Passes all arguments in parameter space.
88 /// PTX_Device - Call to a PTX device function.
89 /// Passes all arguments in register or parameter space.
92 /// MBLAZE_INTR - Calling convention used for MBlaze interrupt routines.
95 /// MBLAZE_INTR - Calling convention used for MBlaze interrupt support
96 /// routines (i.e. GCC's save_volatiles attribute).
99 } // End CallingConv namespace
101 } // End llvm namespace