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_CALLINGCONV_H 00015 #define LLVM_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 // Target - This is the start of the target-specific calling conventions, 00048 // e.g. fastcall and thiscall on X86. 00049 FirstTargetCC = 64, 00050 00051 /// X86_StdCall - stdcall is the calling conventions mostly used by the 00052 /// Win32 API. It is basically the same as the C convention with the 00053 /// difference in that the callee is responsible for popping the arguments 00054 /// from the stack. 00055 X86_StdCall = 64, 00056 00057 /// X86_FastCall - 'fast' analog of X86_StdCall. Passes first two arguments 00058 /// in ECX:EDX registers, others - via stack. Callee is responsible for 00059 /// stack cleaning. 00060 X86_FastCall = 65 00061 }; 00062 } // End CallingConv namespace 00063 00064 } // End llvm namespace 00065 00066 #endif