LLVM API Documentation
00001 //===-- llvm/CallingConv.h - LLVM Calling Conventions -----------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file defines LLVM's set of calling conventions. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef LLVM_IR_CALLINGCONV_H 00015 #define LLVM_IR_CALLINGCONV_H 00016 00017 namespace llvm { 00018 00019 /// CallingConv Namespace - This namespace contains an enum with a value for 00020 /// the well-known calling conventions. 00021 /// 00022 namespace CallingConv { 00023 /// A set of enums which specify the assigned numeric values for known llvm 00024 /// calling conventions. 00025 /// @brief LLVM Calling Convention Representation 00026 enum ID { 00027 /// C - The default llvm calling convention, compatible with C. This 00028 /// convention is the only calling convention that supports varargs calls. 00029 /// As with typical C calling conventions, the callee/caller have to 00030 /// tolerate certain amounts of prototype mismatch. 00031 C = 0, 00032 00033 // Generic LLVM calling conventions. None of these calling conventions 00034 // support varargs calls, and all assume that the caller and callee 00035 // prototype exactly match. 00036 00037 /// Fast - This calling convention attempts to make calls as fast as 00038 /// possible (e.g. by passing things in registers). 00039 Fast = 8, 00040 00041 // Cold - This calling convention attempts to make code in the caller as 00042 // efficient as possible under the assumption that the call is not commonly 00043 // executed. As such, these calls often preserve all registers so that the 00044 // call does not break any live ranges in the caller side. 00045 Cold = 9, 00046 00047 // GHC - Calling convention used by the Glasgow Haskell Compiler (GHC). 00048 GHC = 10, 00049 00050 // HiPE - Calling convention used by the High-Performance Erlang Compiler 00051 // (HiPE). 00052 HiPE = 11, 00053 00054 // Target - This is the start of the target-specific calling conventions, 00055 // e.g. fastcall and thiscall on X86. 00056 FirstTargetCC = 64, 00057 00058 /// X86_StdCall - stdcall is the calling conventions mostly used by the 00059 /// Win32 API. It is basically the same as the C convention with the 00060 /// difference in that the callee is responsible for popping the arguments 00061 /// from the stack. 00062 X86_StdCall = 64, 00063 00064 /// X86_FastCall - 'fast' analog of X86_StdCall. Passes first two arguments 00065 /// in ECX:EDX registers, others - via stack. Callee is responsible for 00066 /// stack cleaning. 00067 X86_FastCall = 65, 00068 00069 /// ARM_APCS - ARM Procedure Calling Standard calling convention (obsolete, 00070 /// but still used on some targets). 00071 ARM_APCS = 66, 00072 00073 /// ARM_AAPCS - ARM Architecture Procedure Calling Standard calling 00074 /// convention (aka EABI). Soft float variant. 00075 ARM_AAPCS = 67, 00076 00077 /// ARM_AAPCS_VFP - Same as ARM_AAPCS, but uses hard floating point ABI. 00078 ARM_AAPCS_VFP = 68, 00079 00080 /// MSP430_INTR - Calling convention used for MSP430 interrupt routines. 00081 MSP430_INTR = 69, 00082 00083 /// X86_ThisCall - Similar to X86_StdCall. Passes first argument in ECX, 00084 /// others via stack. Callee is responsible for stack cleaning. MSVC uses 00085 /// this by default for methods in its ABI. 00086 X86_ThisCall = 70, 00087 00088 /// PTX_Kernel - Call to a PTX kernel. 00089 /// Passes all arguments in parameter space. 00090 PTX_Kernel = 71, 00091 00092 /// PTX_Device - Call to a PTX device function. 00093 /// Passes all arguments in register or parameter space. 00094 PTX_Device = 72, 00095 00096 /// MBLAZE_INTR - Calling convention used for MBlaze interrupt routines. 00097 MBLAZE_INTR = 73, 00098 00099 /// MBLAZE_INTR - Calling convention used for MBlaze interrupt support 00100 /// routines (i.e. GCC's save_volatiles attribute). 00101 MBLAZE_SVOL = 74, 00102 00103 /// SPIR_FUNC - Calling convention for SPIR non-kernel device functions. 00104 /// No lowering or expansion of arguments. 00105 /// Structures are passed as a pointer to a struct with the byval attribute. 00106 /// Functions can only call SPIR_FUNC and SPIR_KERNEL functions. 00107 /// Functions can only have zero or one return values. 00108 /// Variable arguments are not allowed, except for printf. 00109 /// How arguments/return values are lowered are not specified. 00110 /// Functions are only visible to the devices. 00111 SPIR_FUNC = 75, 00112 00113 /// SPIR_KERNEL - Calling convention for SPIR kernel functions. 00114 /// Inherits the restrictions of SPIR_FUNC, except 00115 /// Cannot have non-void return values. 00116 /// Cannot have variable arguments. 00117 /// Can also be called by the host. 00118 /// Is externally visible. 00119 SPIR_KERNEL = 76, 00120 00121 /// Intel_OCL_BI - Calling conventions for Intel OpenCL built-ins 00122 Intel_OCL_BI = 77 00123 00124 }; 00125 } // End CallingConv namespace 00126 00127 } // End llvm namespace 00128 00129 #endif